Commit 5f7666ba authored by Henri-Damien LAURENT's avatar Henri-Damien LAURENT

hotline#104010 : OPAC Article : Dates were defaulted to erroneous values in Articles Display.

parent 40cc2e69
Pipeline #9735 passed with stage
in 44 minutes and 28 seconds
- ticket #104010 : OPAC : Suppression des dates par défaut erronées (début événement, fin événement) dans l'affichage des articles.
\ No newline at end of file
......@@ -46,12 +46,16 @@ class ZendAfi_View_Helper_TagArticleInfo extends ZendAfi_View_Helper_BaseHelper
protected function _dayMonth($strdate) {
return strftime('%a %d %b', strtotime($strdate));
return $strdate
? strftime('%a %d %b', strtotime($strdate))
: '';
}
protected function _hour($strdate) {
return strftime('%Hh%M', strtotime($strdate));
return $strdate
? strftime('%Hh%M', strtotime($strdate))
: '';
}
......
......@@ -967,6 +967,46 @@ class CmsControllerArticleWithBibRewriteUrlViewTest extends CmsControllerWithFet
class CmsControllerArticleWithoutEventDatesTest extends CmsControllerWithFeteDeLaFriteTestCase {
public function setUp() {
parent::setUp();
Class_Article::find(224)->setDateDebut('2020-01-10')
->setDateFin('')
->setEventsDebut('')
->setEventsFin('')
->assertSave();
$this->dispatch('/cms/articleview/id/224', true);
}
/** @test */
public function pageShouldNotContainDTEventStartDate() {
$this->assertNotXPath('//dt[@class="event_start_date"]');
}
/** @test */
public function pageShouldNotContainDTEventEndDate() {
$this->assertNotXPath('//dt[@class="event_end_date"]');
}
/** @test */
public function pageShouldNotContainDTEventStartHour() {
$this->assertNotXPath('//dt[@class="event_start_hour"]');
}
/** @test */
public function pageShouldNotContainDTEventEndHour() {
$this->assertNotXPath('//dt[@class="event_end_hour"]');
}
}
class CmsControllerArticleViewTest extends CmsControllerWithFeteDeLaFriteTestCase {
protected function _loginHook($account) {
$account->ROLE_LEVEL = ZendAfi_Acl_AdminControllerRoles::ABONNE_SIGB;
......
Markdown is supported
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