Commit c7bdcc5c authored by Patrick Barroca's avatar Patrick Barroca 🐧

Merge branch 'hotline#104010_faux_horaire_01h00_01h00_sur_les_articles_evenements' into 'hotline'

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

See merge request !3446
parents 9266f935 5f7666ba
Pipeline #9748 passed with stage
in 43 minutes and 19 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