diff --git a/tests/application/modules/opac/controllers/CmsControllerTest.php b/tests/application/modules/opac/controllers/CmsControllerTest.php index 9ca215f45647306563514396eb3ea2fa4e10f26b..55b5fa403adeda6f616fe096adf5ee0dd21480a0 100644 --- a/tests/application/modules/opac/controllers/CmsControllerTest.php +++ b/tests/application/modules/opac/controllers/CmsControllerTest.php @@ -268,8 +268,10 @@ abstract class AbstractCmsControllerArticleViewByDateTest extends AbstractContro 'rss_avis' => false, 'boite' => null ]; + if ($this->display_mode == "Summary") $prefs_module_calendar['summary_content']="Summary"; + $this->_article_loader = Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Article') ->whenCalled('getArticlesByPreferences') ->with($prefs_module_calendar) @@ -347,6 +349,8 @@ class CmsControllerArticleViewByDateTest extends AbstractCmsControllerArticleVie } + + class CmsControllerProfilDivisionTest extends AbstractCmsControllerArticleViewByDateTest { public function setUp() { parent::setUp(); @@ -357,8 +361,8 @@ class CmsControllerProfilDivisionTest extends AbstractCmsControllerArticleViewBy 'select_annexe' => 'on']], '10' => ['division' => '3', - 'type_module' => 'NEWSLETTERS', - 'preferences' => ['titre' => 'Lettres d\'informations']], + 'type_module' => 'NEWS', + 'preferences' => ['titre' => 'Articles']], '11' => ['division' => '1', 'type_module' => 'LOGIN', @@ -371,55 +375,52 @@ class CmsControllerProfilDivisionTest extends AbstractCmsControllerArticleViewBy /** @test */ - public function boiteNewsletterShouldNotBeDisplayed() { - $this->assertNotXPath("//div[contains(@class, 'colDroite')]//div[@class='boite_newsletters']",$this->_response->getBody()); + public function boiteNewsShouldNotBeDisplayed() { + $this->assertNotXPath("//div[contains(@class, 'colDroite')]//div[@class='boite news']",$this->_response->getBody()); } /** @test */ public function boiteLoginShouldBeDisplayedAtLeft() { $this->assertXPath("//div[contains(@class, 'colGauche')]//div[@id='boite_login']",$this->_response->getBody()); - } - public function selectedDivisionThreeAlwaysVisible() { - $cfg_site=Class_Profil::getCurrentProfil()-> getCfgSiteAsArray(); - $cfg_site['division_three_always_visible']=true; - Class_Profil::getCurrentProfil()->setCfgSite($cfg_site); - } - /** @test */ - public function boiteNewsletterShouldBeDisplayedIfDivisionThreeVisibleSelected() { - $this->selectedDivisionThreeAlwaysVisible(); + public function boiteNewsShouldBeDisplayedIfDivisionThreeVisibleSelected() { + $this->bootstrap(); + Class_Profil::getCurrentProfil()->setDivisionThreeAlwaysVisible(true); $this->dispatch('/cms/articleviewbydate?d=2011-09-03&id_module=8&id_profil=2&select_id_categorie=all', true); - $this->assertXPath("//div[contains(@class, 'colDroite')]//div[@class='boite_newsletters']",$this->_response->getBody()); + $this->assertXPath("//div[contains(@class, 'colDroite')]//div[@class='boite news']"); } /** @test */ public function boiteLoginShouldBeDisplayedAtRightWhenReverseOrder() { + $this->bootstrap(); Class_Profil::getCurrentProfil()->setOrdreDivisions(1); $this->dispatch('/cms/articleviewbydate?d=2011-09-03&id_module=8&id_profil=2&select_id_categorie=all', true); - $this->assertXPath("//div[contains(@class, 'colDroite')]//div[@id='boite_login']",$this->_response->getBody()); + $this->assertXPath("//div[contains(@class, 'colDroite')]//div[@class='boite login']",$this->_response->getBody()); } /** @test */ - public function boiteNewsletterShouldNotBeDisplayedWhenReverseOrder() { + public function boiteNewsShouldNotBeDisplayedWhenReverseOrder() { + $this->bootstrap(); Class_Profil::getCurrentProfil()->setOrdreDivisions(1); $this->dispatch('/cms/articleviewbydate?d=2011-09-03&id_module=8&id_profil=2&select_id_categorie=all', true); - $this->assertNotXPath("//div[contains(@class, 'colGauche')]//div[@class='boite_newsletters']",$this->_response->getBody()); + $this->assertNotXPath("//div[contains(@class, 'colGauche')]//div[@class='boite news']",$this->_response->getBody()); } /** @test */ - public function boiteNewsletterShouldBeDisplayedWhenReverseOrderAndDivisionThreeVisibleSelected() { - - $this->selectedDivisionThreeAlwaysVisible(); - Class_Profil::getCurrentProfil()->setOrdreDivisions(1); + public function boiteNewsShouldBeDisplayedWhenReverseOrderAndDivisionThreeVisibleSelected() { + $this->bootstrap(); + Class_Profil::getCurrentProfil() + ->setOrdreDivisions(1) + ->setDivisionThreeAlwaysVisible(true); $this->dispatch('/cms/articleviewbydate?d=2011-09-03&id_module=8&id_profil=2&select_id_categorie=all', true); - $this->assertXPath("//div[contains(@class, 'colGauche')]//div[@class='boite_newsletters']",$this->_response->getBody()); + $this->assertXPath("//div[contains(@class, 'colGauche')]//div[@class='boite news']",$this->_response->getBody()); }