diff --git a/application/modules/opac/controllers/CmsController.php b/application/modules/opac/controllers/CmsController.php index ece7728d4807c31268f6f5dd58a35cac2d6f8c36..654df7a60c526329f4bca4700b8b7da9ee7c0bc4 100644 --- a/application/modules/opac/controllers/CmsController.php +++ b/application/modules/opac/controllers/CmsController.php @@ -92,7 +92,6 @@ class CmsController extends Zend_Controller_Action { && ('' != $preferences['id_categorie']) ) { if ('Random' == $preferences['display_order']) { - $preferences['display_order'] = 'DateCreation'; $preferences['nb_aff'] = $preferences['nb_analyse']; } } else { @@ -101,6 +100,7 @@ class CmsController extends Zend_Controller_Action { $preferences['events_only'] = true; $preferences['published'] = true; + $preferences['display_order'] = 'EventDebut'; $articles = Class_Article::getArticlesByPreferences($preferences); $articles = Class_Article::filterByLocaleAndWorkflow($articles); @@ -329,7 +329,7 @@ class CmsController extends Zend_Controller_Action { 'link' => $this->_request->getScheme() . '://' . $this->_request->getServer('HTTP_HOST') . $this->view->url($article->getUrl()), - 'description' => html_entity_decode(Class_CmsUrlTransformer::imgUrlRelativeToAbsolute($article->getFullContent())), + 'description' => html_entity_decode(Class_CmsUrlTransformer::imgUrlRelativeToAbsolute($this->view->tagArticleEvent($article).$article->getFullContent())), 'lastUpdate' => strtotime($article->hasDebut() ? $article->getDebut() : $article->getDateMaj()) diff --git a/tests/application/modules/opac/controllers/CmsControllerTest.php b/tests/application/modules/opac/controllers/CmsControllerTest.php index 229ade55aa92d60700ba0ea5e0f19a89823b474d..91a61e11b597b619d719cb3ab64ba2c36d67b617 100644 --- a/tests/application/modules/opac/controllers/CmsControllerTest.php +++ b/tests/application/modules/opac/controllers/CmsControllerTest.php @@ -82,7 +82,7 @@ extends AbstractControllerTestCase { 'id_items' => '', 'nb_aff' => 2, 'nb_analyse' => 5, - 'display_order' => 'Random', + 'display_order' => 'EventDebut', 'display_titles_only' => false, 'rss_avis' => 1, 'op_largeur_img' => 200, @@ -103,7 +103,9 @@ extends AbstractControllerTestCase { ['id' => 2, 'titre' => 'La fête de la frite', 'contenu' => 'Une fête qui sent !', - 'debut' => '2012-12-12 12:12:12']), + 'debut' => '2012-12-12 12:12:12', + 'events_debut' => '2012-12-13', + 'all_day' => true]), ]) ->beStrict(); @@ -112,6 +114,7 @@ extends AbstractControllerTestCase { } + /** @test */ public function imgShouldBeDisplayWithAbsoluteUrl() { $this->assertXPathContentContains('//description', @@ -146,12 +149,21 @@ extends AbstractControllerTestCase { } - /** @test */ + /** @test */ public function secondItemDateShouldBe12_12_2012() { $this->assertXpathContentContains('//channel/item[2]/pubDate', '12 Dec 2012', $this->_response->getBody()); } + + + /** @test */ + public function secondItemContentShouldContainsLe13Decembre() { + $this->assertXPathContentContains('//channel/item[2]/description', + 'Le 13 décembre', + $this->_response->getBody()); + + } }