Skip to content
Snippets Groups Projects
Commit e748de67 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

Merge branch 'hotline#78811_horaires_exceptionnels' into 'hotline'

hotline #78811 openings: validity end date is inclusive

See merge request !2813
parents 10b6417f 6c0a9fd8
Branches
Tags
2 merge requests!2816Hotline,!2813hotline #78811 openings: validity end date is inclusive
Pipeline #4935 passed with stage
in 44 minutes and 57 seconds
- ticket #78811 : Horaires exceptionnels d'ouverture: la date de fin de restriction d'ouverture est inclusive
\ No newline at end of file
......@@ -221,7 +221,7 @@ class Class_Ouverture extends Storm_Model_Abstract {
public function isValidOnDate($time) {
$time_start = strtotime($this->getValidityStart());
$time_end = strtotime($this->getValidityEnd());
$time_end = strtotime($this->getValidityEnd() . ' +1 day');
if (($time_start <= 0) && ($time_end <= 0))
return true;
......
......@@ -313,7 +313,7 @@ class ZendAfi_View_Helper_RenderLibraryOpeningsOnValidityRangeTest extends ZendA
'horaires' => ['00:00', '00:00', '14:00', '18:00'],
'jour' => '',
'validity_start' => '2015-09-01',
'validity_end' => '2015-12-31',
'validity_end' => '2015-12-29',
'jour_semaine' => Class_Ouverture::MARDI]))
->addOuverture($end_only = $this->fixture('Class_Ouverture',
......@@ -355,6 +355,16 @@ class ZendAfi_View_Helper_RenderLibraryOpeningsOnValidityRangeTest extends ZendA
}
/** @test */
public function on29_12_2015_SelectedOpeningShouldBeStartEnd() {
ZendAfi_View_Helper_RenderLibraryOpening::setTimeSource(new TimeSourceForTest('2015-12-29 11:00:00'));
$this->assertXPathContentContains($this->_renderOpening($this->cran),
'//p',
utf8_encode('Ouvrira à 14:00'));
}
/** @test */
public function on05_10_2015_SelectedOpeningShouldBeStartEnd() {
ZendAfi_View_Helper_RenderLibraryOpening::setTimeSource(new TimeSourceForTest('2015-10-05 11:00:00'));
......
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