Skip to content
Snippets Groups Projects
Commit 45d85250 authored by gloas's avatar gloas
Browse files

Ajout de tests sur admin/catalogue/domaines-paniers-json

parent 3f887367
No related merge requests found
......@@ -116,26 +116,55 @@ class CatalogueControllerJsonActionTest extends AbstractControllerTestCase {
parent::setup();
Storm_Test_ObjectWrapper::onLoaderOfModel('Class_PanierNotice')
->whenCalled('findAllBy')
->answers([])
->whenCalled('findAllWithNoCatalogueBelongsToAdmin')
->answers([]);
Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Catalogue')
->whenCalled('findTopCatalogues')
->answers([]);
}
}
/** @test */
public function domainesActionShouldReturnJson() {
$this->dispatch('/admin/catalogue/domaines');
$this->assertJsonStringEqualsJsonString(
$this->_response->getBody(),
json_encode([
["id" => "domaines_paniers",
"label" => "Domaines",
"categories" => [],
"items" => [],
"options" => ['ico' => BASE_URL.'/public/admin/images/picto/domaines_16.png',
"multipleSelection" => false]]]),
$this->_response->getBody());
$this->dispatch('/admin/catalogue/domaines');
$this->assertJsonStringEqualsJsonString(
$this->_response->getBody(),
json_encode([
["id" => "domaines_paniers",
"label" => "Domaines",
"categories" => [],
"items" => [],
"options" => ['ico' => BASE_URL.'/public/admin/images/picto/domaines_16.png',
"multipleSelection" => false]]]),
$this->_response->getBody());
}
/** @test */
public function domainesPaniersJsonActionShouldReturnJson() {
$this->dispatch('/admin/catalogue/domaines-paniers-json');
$this->assertJsonStringEqualsJsonString(
$this->_response->getBody(),
json_encode([
["id" => "panier_for_user",
"label" => "Mes paniers",
"categories" => [],
"items" => [],
"options" => ["multipleSelection" => false]],
["id" => "domaines_paniers",
"label" => "Domaines",
"categories" => [],
"items" => [],
"options" => ['ico' => BASE_URL.'/public/admin/images/picto/domaines_16.png',
"multipleSelection" => false]],
["id" => "paniers_by_users",
"label" => "Paniers sans domaine, rattachés à leur créateur",
"categories" => [],
"items" => [],
"options" => ["multipleSelection" => false]]]),
$this->_response->getBody());
}
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment