diff --git a/tests/application/modules/opac/controllers/CatalogueControllerTest.php b/tests/application/modules/opac/controllers/CatalogueControllerTest.php index 6a3ea647fcf919a59b7303f4e85144e2adaad3a6..964cd48d4a3a4761f00c27d11db0c5e3ef48fae5 100644 --- a/tests/application/modules/opac/controllers/CatalogueControllerTest.php +++ b/tests/application/modules/opac/controllers/CatalogueControllerTest.php @@ -29,14 +29,17 @@ class CatalogueControllerAppelMenuTest extends AbstractControllerTestCase { $this->_sql = Zend_Registry::get('sql'); $this->_sql_mock = Storm_Test_ObjectWrapper::mock() - ->whenCalled('fetchOne') - ->answers(null) + ->whenCalled('fetchOne') + ->answers(null) ->whenCalled('execute') ->answers(null) - ->whenCalled('fetchAll') - ->answers([]); + ->whenCalled('fetchAll') + ->answers([]); Zend_Registry::set('sql', $this->_sql_mock); + + Class_Catalogue::newInstanceWithId(151, ['libelle' => 'Nouveautés', + 'type_doc' => '1;3;4;5']); } @@ -61,13 +64,7 @@ class CatalogueControllerAppelMenuTest extends AbstractControllerTestCase { * @test */ public function getFacettesSqlError() { - $catalogue_test = Class_Catalogue::getLoader() - ->newInstanceWithId(151) - ->setLibelle('nouveautés') - ->setTypeDoc('1;3;4;5'); - $this->_dispatchQuery('titre=Catalogue&aleatoire=0&tri=1&nb_notices=+&nb_analyse=&id_catalogue=151&id_panier=0&id_user=0&reset=true'); - $this->assertXPathContentContains('//h1', 'Catalogue'); } @@ -82,7 +79,7 @@ class CatalogueControllerAppelMenuTest extends AbstractControllerTestCase { /** @test */ public function withOldAppelMenuShouldRedirectToRechercheSimple() { - $this->dispatch('/recherche/appelmenu?id_catalogue=12',true); + $this->dispatch('/recherche/appelmenu?id_catalogue=151',true); $this->assertXPathContentContains('//h1', 'Nouveautés',$this->_response->getBody()); }