diff --git a/application/modules/admin/views/scripts/accueil/calendrier.phtml b/application/modules/admin/views/scripts/accueil/calendrier.phtml index 2f8cd3415e59413fc1e5fd7d9487e90760210877..2bd42f1071b97685cbeaa461254828836df5b006 100644 --- a/application/modules/admin/views/scripts/accueil/calendrier.phtml +++ b/application/modules/admin/views/scripts/accueil/calendrier.phtml @@ -12,28 +12,16 @@ <td class="gauche"><?php echo $this->combo_templates ?></td> </tr> + <tr> - <td class="droite">Afficher le calendrier</td> + <td class="droite">Nombre d'évènements à afficher</td> <td class="gauche"> - <?php echo $this->formCheckbox('display_calendar', - $this->preferences['display_calendar'], - null, - array('1', '0')) ?> + <?php echo $this->formText('nb_events', + $this->preferences['nb_events'], + array('size' => '2', + 'maxlenghth' => '2')) ?> </td> - </tr> - - <tr> - <td class="droite">Mode d'affichage des rendez-vous </td> - <td class="gauche"> - <?php - echo $this->formRadioButtons("mode-affichage", - '', - ["ligne" => "En ligne", - "liste" => "En liste", - "none"=> "Ne pas afficher"]); - ?> - </td> - </tr> + </tr> </table> </fieldset> @@ -61,26 +49,32 @@ <br/> <fieldset> - <legend>Prochains rendez-vous</legend> + <legend>Affichage de la boite calendrier</legend> <table cellspacing="2"> <tr> - <td class="droite">Nombre de rendez-vous </td> + <td class="droite">Afficher le calendrier</td> <td class="gauche"> - <?php echo $this->formText('nb_events', - $this->preferences['nb_events'], - array('size' => '2', - 'maxlenghth' => '2')) ?> + <?php echo $this->formCheckbox('display_calendar', + $this->preferences['display_calendar'], + null, + array('1', '0')) ?> </td> </tr> + <tr> - <td class="droite" valign="top">Style de représentation </td> - <td class="gauche"><?php echo $this->imageViewersOptions($this->preferences); ?></td> - </tr> - - <tr> - <td class="droite">Informations supplémentaires </td> + <td class="droite">Mode d'affichage des évènements</td> <td class="gauche"> + <?php + echo $this->formRadioButtons("mode-affichage", + $this->preferences["mode-affichage"], + ["simple" => "mode liste simple", + "article" => "mode résumé d'article", + "none"=> "Ne pas afficher"]); + ?> + </td> + + <td class="gauche"> <?php echo $this->formRadioButtons("display_event_info", $this->preferences["display_event_info"], @@ -96,7 +90,7 @@ <br/> <fieldset> - <legend>Affichage des articles</legend> + <legend>Affichage en pleine page</legend> <table cellspacing="2" width="100%"> <tr> <td class="droite">Afficher </td> diff --git a/application/modules/opac/controllers/CmsController.php b/application/modules/opac/controllers/CmsController.php index 1d9a0114f67681d680017f810b1b0c85d9a87aa7..55fcb2d1824b49748e8c0cf95ca603d854ffed8a 100644 --- a/application/modules/opac/controllers/CmsController.php +++ b/application/modules/opac/controllers/CmsController.php @@ -274,21 +274,23 @@ class CmsController extends Zend_Controller_Action { } // param pour l'affichage du calendar - $param["DATE"]=$date; - $param["URL"]=""; - $param["ID_BIB"]=Class_Profil::getCurrentProfil()->getIdSite(); - $param["AFFICH_MOIS"]=1; - $param["NEWS"]["AFFICH_NEWS"]=1; - $param["NB_NEWS"]= (int)$preferences["nb_events"]; - $param["ALEATOIRE"]=1; - $param["ID_MODULE"] = $id_module; - $param["ID_CAT"] = $preferences['id_categorie']; - $param["SELECT_ID_CAT"] = $preferences["display_cat_select"] - ? $this->_getParam("select_id_categorie") - : "all"; - $param["DISPLAY_CAT_SELECT"] = $preferences["display_cat_select"]; - $param["DISPLAY_NEXT_EVENT"] = $preferences["display_next_event"]; - $param["EVENT_INFO"] = $preferences["display_event_info"]; + $param['DATE']=$date; + $param['URL']=''; + $param['ID_BIB']=Class_Profil::getCurrentProfil()->getIdSite(); + $param['AFFICH_MOIS']=1; + $param['NEWS']['AFFICH_NEWS']=1; + $param['NB_NEWS']= (int)$preferences['nb_events']; + $param['ALEATOIRE']=1; + $param['ID_MODULE'] = $id_module; + $param['ID_CAT'] = $preferences['id_categorie']; + $param['SELECT_ID_CAT'] = $preferences['display_cat_select'] + ? $this->_getParam('select_id_categorie') + : 'all'; + $param['DISPLAY_CAT_SELECT'] = $preferences['display_cat_select']; + $param['MODE_AFFICHAGE'] = $preferences['mode-affichage']; + $param['DISPLAY_CALENDAR'] = $preferences['display_calendar']; + + $param['EVENT_INFO'] = $preferences['display_event_info']; $class_calendar = new Class_Calendar($param, $this->view); $this->getResponse()->setBody($class_calendar->rendHTML()); } diff --git a/library/Class/Calendar.php b/library/Class/Calendar.php index 61aaf3e687edfc6b8ab4366687b34d9a2c1c8002..7f6737cf58d350109d0ff853b7b0c3917f207ecd 100644 --- a/library/Class/Calendar.php +++ b/library/Class/Calendar.php @@ -180,7 +180,7 @@ class Class_Calendar { * * N'est affiché que si l'option administrateur est cochée param["DISPLAY_CAT_SELECT"] */ - protected function rendSelectionCategories() { + public function rendSelectionCategories() { if ($this->param["DISPLAY_CAT_SELECT"]==null) return; $cats = $this->_getAdminSelectedCategories(); @@ -209,7 +209,7 @@ class Class_Calendar { /* Retourne la catégorie de l'article ou la bibliothèque selon l'option administrateur * $this->param["EVENT_INFO"] */ - protected function _getArticleEventInfo($news){ + public function getArticleEventInfo($news){ $label = 'Portail'; $params = "b=0"; @@ -284,12 +284,11 @@ class Class_Calendar { } - public function rendHTML() { - $this->initializeParams(); - - $html = $this->rendSelectionCategories(); - - $html.="<div><table class=\"calendar_main\">"; + public function rendCalendarTable() { + if($this->param['DISPLAY_CALENDAR']=='0') + return ''; + + $html ="<div><table class=\"calendar_main\">"; $html.=" <tr class=\"calendar_title\">"; $html.=" <td class=\"calendar_title_left_arrow\"></td>"; $html.=" <td class=\"calendar_title_month\"> @@ -379,22 +378,19 @@ class Class_Calendar { $html.=" </tr>"; $html.="</table></div>"; - // Html sous le calendrier - $html .= $this->htmlForEvents(); - + return $html; - return sprintf("<div class='calendar'>%s</div>", $html); } - - protected function htmlForEvents() { - if ($this->param['DISPLAY_NEXT_EVENT']=='0') - return ''; + public function getArticles() { $articles = $this->_getNextEvents(); $nb_news = $this->param["NB_NEWS"]; - $news_array = array_slice($articles, 0, $nb_news); + return array_slice($articles, 0, $nb_news); + } + + public function rendArticlesBySimpleList($news_array) { $news_html = sprintf( "<div class='calendar_event_list'>". "<p style='text-align:center'>". @@ -404,7 +400,7 @@ class Class_Calendar { $news_li_html = ''; foreach($news_array as $news) { // Information à afficher: Catégorie ou Bibliothèque - $event_info = $this->_getArticleEventInfo($news); + $event_info = $this->getArticleEventInfo($news); // Filtre titre $libelle = $news->getTitre(); @@ -423,7 +419,7 @@ class Class_Calendar { // Pour l'affichage - function formateDateZend($news) { + public function formateDateZend($news) { if (!isset($this->_article_event_helper)) { $this->_article_event_helper = $this->_view->getHelper('TagArticleEvent'); } diff --git a/library/Class/Systeme/ModulesAccueil/Calendrier.php b/library/Class/Systeme/ModulesAccueil/Calendrier.php index 9faf39bc2830e4c76e71173db2b7e326b2697e95..1452bf827bfc39e849d4b56ce3881737cd7ef6bf 100644 --- a/library/Class/Systeme/ModulesAccueil/Calendrier.php +++ b/library/Class/Systeme/ModulesAccueil/Calendrier.php @@ -51,7 +51,7 @@ class Class_Systeme_ModulesAccueil_Calendrier extends Class_Systeme_ModulesAccue 'display_mode' => 'Title', // Mode d'affichage Title, Summary, FullArticle, 'nb_events' => '3', // Nombre de rendez-vous à afficher 'display_calendar' => '1', - 'mode-affichage' => 'ligne' + 'mode-affichage' => 'simple' ); diff --git a/library/ZendAfi/View/Helper/Accueil/Calendar.php b/library/ZendAfi/View/Helper/Accueil/Calendar.php index f94fcb17827a03007f38dec9e538b2c07742251c..74755fba2f652867ffb5524c8dc10039b0fbf310 100644 --- a/library/ZendAfi/View/Helper/Accueil/Calendar.php +++ b/library/ZendAfi/View/Helper/Accueil/Calendar.php @@ -21,6 +21,9 @@ class ZendAfi_View_Helper_Accueil_Calendar extends ZendAfi_View_Helper_Accueil_Base { use Trait_TimeSource; + + protected $class_calendar; + protected function _renderHeadScriptsOn($script_loader) { $script_loader->addJQueryReady($this->_getAjaxCalendarScript()); } @@ -77,24 +80,69 @@ SCRIPT; $param = array(); if (array_isset('display_date', $this->preferences)) - $param["DATE"] = $this->preferences['display_date']; - $param["URL"]=""; - $param["ID_BIB"]=Class_Profil::getCurrentProfil()->getIdSite(); - $param["NB_NEWS"]=(int)$this->preferences["nb_events"]; - $param["ID_MODULE"] = $this->id_module; - $param["ID_CAT"] = $this->preferences["id_categorie"]; - $param["SELECT_ID_CAT"] = array_isset("select_id_categorie", $this->preferences) ? $this->preferences["select_id_categorie"] : "all"; - $param["DISPLAY_CAT_SELECT"] = array_isset("display_cat_select", $this->preferences) ? $this->preferences["display_cat_select"] : false; - $param["EVENT_INFO"] = $this->preferences["display_event_info"]; - $param["ALEATOIRE"] = 1; - $param["DISPLAY_NEXT_EVENT"] = array_key_exists('display_next_event', $this->preferences) ? $this->preferences["display_next_event"] : '1'; - - $class_calendar = new Class_Calendar($param, $this->view); - $class_calendar->setTimeSource($this->getTimeSource()); - $this->contenu = $class_calendar->rendHTML(); - + $param['DATE'] = $this->preferences['display_date']; + $param['URL']=''; + $param['ID_BIB']=Class_Profil::getCurrentProfil()->getIdSite(); + $param['NB_NEWS']=(int)$this->preferences['nb_events']; + $param['ID_MODULE'] = $this->id_module; + $param['ID_CAT'] = $this->preferences['id_categorie']; + $param['SELECT_ID_CAT'] = array_isset('select_id_categorie', $this->preferences) ? $this->preferences['select_id_categorie'] : 'all'; + $param['DISPLAY_CAT_SELECT'] = array_isset('display_cat_select', $this->preferences) ? $this->preferences['display_cat_select'] : false; + $param['EVENT_INFO'] = $this->preferences['display_event_info']; + $param['ALEATOIRE'] = 1; + $param['MODE_AFFICHAGE'] = array_key_exists('mode-affichage', $this->preferences) ? $this->preferences['mode-affichage'] : 'simple'; + $param['DISPLAY_CALENDAR'] = $this->preferences['display_calendar']; + + $this->contenu = $this->getCalendarContenu($param); return $this->getHtmlArray(); } + + protected function getCalendarContenu($param) { + $this->class_calendar = new Class_Calendar($param, $this->view); + $this->class_calendar->setTimeSource($this->getTimeSource()); + $this->class_calendar->initializeParams(); + + $articles = $this->class_calendar->getArticles(); + + $html='<div class="calendar">'; + $html.= $this->class_calendar->rendSelectionCategories(); + $html.= $this->class_calendar->rendCalendarTable(); + $html.= $this->getDisplayForArticles($articles,$param); + return $html.='</div>'; + } + + + protected function getDisplayForArticles($articles, $param) { + $html = ''; + if ($param['MODE_AFFICHAGE']=='none') + return $html; + + if($param['MODE_AFFICHAGE']=='simple') + $html = $this->class_calendar->rendArticlesBySimpleList($articles); + + if($param['MODE_AFFICHAGE']=='article') + $html = $this->rendArticlesByArticleList($articles); + + return $html; + } + + + public function rendArticlesByArticleList($articles) { + if(!$articles) + return ''; + + $html= '<div class="agenda-summary">'; + foreach($articles as $article){ + $options = + $this->class_calendar->getArticleEventInfo($article). + $this->class_calendar->formateDateZend($article); + $html.=$this->view->summaryArticle($article, $options); + } + return $html.='</div>'; + } + + + } \ No newline at end of file diff --git a/tests/application/modules/admin/controllers/AccueilControllerTest.php b/tests/application/modules/admin/controllers/AccueilControllerTest.php index a1761869e8193f1c50b52623c918cdd59b8fb8f2..fb4bf5b0c7f2d433161af680c7fb62dd12f958a6 100644 --- a/tests/application/modules/admin/controllers/AccueilControllerTest.php +++ b/tests/application/modules/admin/controllers/AccueilControllerTest.php @@ -323,13 +323,13 @@ class AccueilControllerConfigCalendrierTest extends Admin_AbstractControllerTest /** @test **/ public function formTableAffichageShouldContainsModeAffichageLigne() { - $this->assertXPath('//input[@type="radio"][@name="mode-affichage"][@value="ligne"]'); + $this->assertXPath('//input[@type="radio"][@name="mode-affichage"][@value="simple"]'); } /** @test **/ public function formTableAffichageShouldContainsModeAffichageListe() { - $this->assertXPath('//input[@type="radio"][@name="mode-affichage"][@value="liste"]'); + $this->assertXPath('//input[@type="radio"][@name="mode-affichage"][@value="article"]'); } diff --git a/tests/application/modules/opac/controllers/CmsControllerTest.php b/tests/application/modules/opac/controllers/CmsControllerTest.php index d64c59820ab0a48326586ca196458e6a0c8a4ae3..598c043894a7b95168c9955369a7a019e1427d82 100644 --- a/tests/application/modules/opac/controllers/CmsControllerTest.php +++ b/tests/application/modules/opac/controllers/CmsControllerTest.php @@ -273,6 +273,7 @@ abstract class AbstractCmsControllerArticleViewByDateTest extends AbstractContro ->whenCalled('getArticlesByPreferences') ->with($prefs_module_calendar) ->answers($articles) + ->whenCalled('getArticlesByPreferences') ->with([ 'event_date' => '2011-09-03', @@ -282,6 +283,9 @@ abstract class AbstractCmsControllerArticleViewByDateTest extends AbstractContro 'display_mode' => $this->display_mode, 'display_order' => $this->display_order ]) + ->answers($articles) + + ->whenCalled('getArticlesByPreferences') ->answers($articles); $this->dispatch('/cms/articleviewbydate?d=2011-09-03&id_module=8&id_profil=2&select_id_categorie=all', true); @@ -299,7 +303,7 @@ class CmsControllerArticleViewByDateTest extends AbstractCmsControllerArticleVie } /** @test */ public function feteDeLaBananeTitleShouldBePresent() { - $this->assertXpathContentContains('//ul//li//a', 'La fête de la banane',$this->_response->getBody()); + $this->assertXpathContentContains('//ul//li//a', 'La fête de la banane'); } @@ -354,7 +358,7 @@ class CmsControllerCalendarDisplayOrderTest extends AbstractCmsControllerArticle /** @test */ public function feteDeLaBananeArticleShouldBeTheFirstArticle() { - $this->assertXpathContentContains('//div/ul/li/ul/li[1]/span/a','La fête de la frite',$this->_response->getBody()); + $this->assertXpathContentContains('//div/ul/li/ul/li[1]/span/a','La fête de la frite'); } @@ -386,7 +390,7 @@ class CmsControllerArticleViewByDateWithOnlyArticlePortailTest extends AbstractC /** @test */ public function emptyBibliothequeLibelleShouldNotBeDisplayedAsPortail() { - $this->assertNotXpathContentContains('//h2', 'Portail', $this->_response->getBody()); + $this->assertNotXpathContentContains('//h2', 'Portail'); } @@ -426,7 +430,7 @@ class CmsControllerArticleViewByDateCategorie23AndNoProfilParamTest extends Abst /** @test */ function contenuShouldContainsAucunContenu() { - $this->assertXPathContentContains('//div', 'Aucun contenu', $this->_response->getBody()); + $this->assertXPathContentContains('//div', 'Aucun contenu'); } @@ -468,7 +472,7 @@ class CmsControllerArticleViewByDateWitoutEventDateTest extends AbstractControll /** @test */ public function articleCorrigeCalendirerShouldBePresent() { - $this->assertXpathContentContains('//ul//li//a', 'Corrige le clic', $this->_response->getBody()); + $this->assertXpathContentContains('//ul//li//a', 'Corrige le clic'); } } @@ -486,18 +490,18 @@ class CmsControllerArticleViewByDateWithRadioSummarySelectedTest extends Abstrac /** @test */ public function articleSummaryLaFeteDeLaBananeShouldBePresent() { - $this->assertXpathContentContains('//h1', 'La fête de la banane',$this->_response->getBody()); + $this->assertXpathContentContains('//h1', 'La fête de la banane'); } /** @test */ public function articleTextLaFeteDeLaBananeShouldContainsSummary() { - $this->assertXpathContentContains('//div', 'Pas qu\'à moitié',$this->_response->getBody()); + $this->assertXpathContentContains('//div', 'Pas qu\'à moitié'); } /** @test */ public function articleTextLaFeteDeLaBananeShouldNotContainsFullArticle() { - $this->assertNotXpathContentContains('//div', ' Une fête qui glisse !',$this->_response->getBody()); + $this->assertNotXpathContentContains('//div', ' Une fête qui glisse !'); } } @@ -515,12 +519,12 @@ class CmsControllerArticleViewByDateWithRadioFullArticleSelectedTest extends Abs /** @test */ public function articleFullTextResumeLaFeteDeLaBananeShouldContainsLaFeteDeLaBanane() { - $this->assertXpathContentContains('//h1', 'La fête de la banane',$this->_response->getBody()); + $this->assertXpathContentContains('//h1', 'La fête de la banane'); } /** @test */ public function articleFullTextLaFeteDeLaBananeShouldContainsUneFeteQuiGlisse() { - $this->assertXpathContentContains('//div', 'Une fête qui glisse !',$this->_response->getBody()); + $this->assertXpathContentContains('//div', 'Une fête qui glisse !'); } } diff --git a/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php b/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php index 426c5076a1bf05201e23ad3bf83da1761c3e1ac0..ce219d69fd16f8b485b2571bd3d0b89fa205fdc8 100644 --- a/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php +++ b/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php @@ -550,6 +550,11 @@ abstract class ProfilOptionsControllerProfilJeunesseWithPagesJeuxMusiqueTestCase '4' => ['division' => '1', 'type_module' => 'NEWS'], + + '45' => ['division' => '1', + 'type_module' => 'CALENDAR', + 'preferences' => ['display_calendar' => '0', + 'mode-affichage' => 'simple']], '8' => ['division' => '2', 'type_module' => 'RESERVATIONS', @@ -652,9 +657,7 @@ class ProfilOptionsControllerProfilJeunesseAndJeuxTest extends ProfilOptionsCont $this->assertQueryContentContains('head title', 'Profil Jeunesse - Se connecter'); } - - - + /** @test **/ public function titleBoitePanierShouldLinkToPanierIndex() { ZendAfi_Auth::getInstance()->logUser(Class_Users::newInstanceWithId(34, ['login' => 'admin'])->beAdminPortail()); @@ -1035,6 +1038,122 @@ class UserRoleLevelThreeViewPrivateProfilTest extends AbstractControllerTestCase } + +class ProfilOptionsControllerProfilBoiteCalendarWithCalendarDisplayedAndModeSimpleTest extends AbstractControllerTestCase { + + public function setup() { + parent::setup(); + + $cfg_accueil = ['modules' => ['45' => ['division' => '1', + 'type_module' => 'CALENDAR', + 'preferences' => ['display_calendar' => '1', + 'mode-affichage' => 'simple']]]]; + + $this->profil_with_calendar = Class_Profil::getCurrentProfil() + ->setBrowser('opac') + ->setTitreSite('Test Calendar') + ->setLibelle('Profil Portail') + ->setCfgAccueil($cfg_accueil); + + $this->dispatch('/opac'); + } + + + /** @test */ + public function boiteCalendarShouldBeDisplay() { + $this->assertXPath('//div[contains(@class,"calendar")]',$this->_response->getBody()); + } + + + /** @test **/ + public function boiteCalendarShouldBeDisplayCalendarTable() { + $this->assertXPath('//table[@class="calendar_main"]', $this->_response->getBody()); + } + + + /** @test **/ + public function boiteCalendarShouldDisplayNextEventAsSimpleListe() { + $this->assertXPath('//ul/li/a[@class="calendar_event_info"]', $this->_response->getBody()); + } +} + + + +class ProfilOptionsControllerProfilBoiteCalendarWithCalendarNotDisplayedAndModeArticleTest extends AbstractControllerTestCase { + + public function setup() { + parent::setup(); + + $cfg_accueil = ['modules' => ['45' => ['division' => '1', + 'type_module' => 'CALENDAR', + 'preferences' => ['display_calendar' => '0', + 'mode-affichage' => 'article']]]]; + + $this->profil_with_calendar = Class_Profil::getCurrentProfil() + ->setBrowser('opac') + ->setTitreSite('Test Calendar') + ->setLibelle('Profil Portail') + ->setCfgAccueil($cfg_accueil); + + $this->dispatch('/opac'); + } + + + /** @test */ + public function boiteCalendarShouldBeDisplay() { + $this->assertXPath('//div[contains(@class,"calendar")]',$this->_response->getBody()); + } + + + /** @test **/ + public function boiteCalendarShouldBeNotDisplayCalendarTable() { + $this->assertNotXPath('//table[@class="calendar_main"]', $this->_response->getBody()); + } + + + /** @test **/ + public function boiteCalendarShouldDisplayNextEventAsArticleListe() { + $this->assertXPath('//div[contains(@class,"agenda-summary")]', $this->_response->getBody()); + } +} +class ProfilOptionsControllerProfilBoiteCalendarWithCalendarNotDisplayedAndDonTDisplayNextEventTest extends AbstractControllerTestCase { + + public function setup() { + parent::setup(); + + $cfg_accueil = ['modules' => ['45' => ['division' => '1', + 'type_module' => 'CALENDAR', + 'preferences' => ['display_calendar' => '0', + 'mode-affichage' => 'none']]]]; + + $this->profil_with_calendar = Class_Profil::getCurrentProfil() + ->setBrowser('opac') + ->setTitreSite('Test Calendar') + ->setLibelle('Profil Portail') + ->setCfgAccueil($cfg_accueil); + + $this->dispatch('/opac'); + } + + + /** @test */ + public function boiteCalendarShouldBeDisplay() { + $this->assertXPath('//div[contains(@class,"calendar")]',$this->_response->getBody()); + } + + + /** @test **/ + public function boiteCalendarShouldBeNotDisplayCalendarTable() { + $this->assertNotXPath('//table[@class="calendar_main"]', $this->_response->getBody()); + } + + + /** @test **/ + public function boiteCalendarShouldNotDisplayNextEvent() { + $this->assertNotXPath('//div[@class="calendar"]/div[2]', $this->_response->getBody()); + } +} + ?> \ No newline at end of file diff --git a/tests/library/ZendAfi/View/Helper/Accueil/CalendarTest.php b/tests/library/ZendAfi/View/Helper/Accueil/CalendarTest.php index d0b65eef874dd7814e781b3339aa74b674fba093..235a2a37afcfe2b4e6b4d914da6e003584e9c310 100644 --- a/tests/library/ZendAfi/View/Helper/Accueil/CalendarTest.php +++ b/tests/library/ZendAfi/View/Helper/Accueil/CalendarTest.php @@ -573,16 +573,17 @@ class CalendarWithCategorySelectorButNoSelectedCategoriesTest extends CalendarViewHelperTestCase { public function setUp() { parent::setUp(); - $params = array('division' => '2', - 'type_module' => 'CALENDAR', - 'preferences' => array('titre' => 'Concerts !', - 'rss_avis' => '0', - 'id_categorie' => '', - 'display_cat_select' => '1', - 'display_event_info' => 'none', - 'select_id_categorie' => '', - 'display_date' => '2011-12-25', - 'display_next_event' => '0')); + $params = ['division' => '2', + 'type_module' => 'CALENDAR', + 'preferences' => ['titre' => 'Concerts !', + 'rss_avis' => '0', + 'id_categorie' => '', + 'display_cat_select' => '1', + 'display_event_info' => 'none', + 'select_id_categorie' => '', + 'display_date' => '2011-12-25', + 'mode-affichage' => 'none', + 'display_calendar' => '1']]; $helper = new ZendAfi_View_Helper_Accueil_Calendar(2, $params); $helper->setView(new ZendAfi_Controller_Action_Helper_View());