Skip to content
Snippets Groups Projects
Commit a00c347f authored by Ghislain Loas's avatar Ghislain Loas
Browse files

Merge branch 'hotline#18395_rss_yonne' into 'stable'

Hotline#18395 rss yonne

See merge request !652
parents 740692fe eae93311
Branches
Tags
3 merge requests!715Master,!664report fix from stable to wip,!663Stable
......@@ -298,6 +298,18 @@ class CmsController extends Zend_Controller_Action {
}
/**
* @param array $article
*/
protected function _getPubDate($article) {
if ($article->hasEventsDebut())
return $article->getEventsDebut();
if ($article->hasDebut())
return $article->getDebut();
return $article->getDateMaj();
}
/**
* @param array $articles
......@@ -313,9 +325,7 @@ class CmsController extends Zend_Controller_Action {
. $this->_request->getServer('HTTP_HOST')
. $this->view->url($article->getUrl()),
'description' => html_entity_decode(Class_CmsUrlTransformer::imgUrlRelativeToAbsolute($article->getFullContent())),
'lastUpdate' => strtotime($article->hasDebut()
? $article->getDebut()
: $article->getDateMaj())
'lastUpdate' => strtotime($this->_getPubDate($article))
];
}
......
......@@ -80,7 +80,8 @@ extends AbstractControllerTestCase {
['id' => 1,
'titre' => 'La fête de la banane',
'contenu' => 'Une fête qui glisse !<img src="'.BASE_URL.'/image/banane.jpg"/>'])
->setDateMaj('2011-11-11 11:11:11');
->setDateMaj('2011-11-11 11:11:11')
->setEventsDebut('2009-09-09 09:09:09');
$fete_frite=$this->fixture('Class_Article',
['id' => 2,
'titre' => 'La fête de la frite',
......@@ -144,9 +145,10 @@ extends AbstractControllerTestCase {
/** @test */
public function firstItemDateShouldBe11_11_2011() {
public function firstItemDateShouldBe09_09_2009() {
$this->assertXpathContentContains('//channel/item[1]/pubDate',
'11 Nov 2011');
'09 Sep 2009',
$this->_response->getBody());
}
......
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