Fix failing tests

- SQL query error
- Reload updated collections in tests (error in test logic)
This commit is contained in:
Thibaud Fabre
2016-01-07 18:57:19 +01:00
parent bf524dac0c
commit 74366feac3
4 changed files with 25 additions and 6 deletions

View File

@@ -439,7 +439,13 @@ class AdminCollectionTest extends \PhraseanetAuthenticatedWebTestCase
$json = $this->getJson(self::$DI['client']->getResponse());
$this->assertTrue($json->success);
// Collection has to be reloaded since it was modified outside of the current process
$databox = $this->getApplication()->findDataboxById($collection->get_sbas_id());
$collection = \collection::getByCollectionId($this->getApplication(), $databox, $collection->get_coll_id());
$this->assertEquals($collection->get_name(), 'test_rename_coll');
$collection->unmount();
$collection->delete();
}
@@ -465,6 +471,10 @@ class AdminCollectionTest extends \PhraseanetAuthenticatedWebTestCase
$json = $this->getJson(self::$DI['client']->getResponse());
$this->assertTrue($json->success);
$databox = $this->getApplication()->findDataboxById($collection->get_sbas_id());
$collection = \collection::getByCollectionId($this->getApplication(), $databox, $collection->get_coll_id());
$this->assertEquals($collection->get_label('de'), 'german label');
$this->assertEquals($collection->get_label('nl'), 'netherlands label');
$this->assertEquals($collection->get_label('fr'), 'label français');

View File

@@ -173,6 +173,7 @@ class UploadTest extends \PhraseanetAuthenticatedWebTestCase
)
]
];
self::$DI['app']['border-manager']->registerChecker(new Sha256(self::$DI['app']));
self::$DI['client']->request('POST', '/prod/upload/', $params, $files, ['HTTP_Accept' => 'application/json']);