diff --git a/library/Class/Article.php b/library/Class/Article.php index 36b89456dae8809f5268022a882b4d94fa4f428e..e2467d4c4af14cfa2daf5bc020a9b4af88cd9516 100644 --- a/library/Class/Article.php +++ b/library/Class/Article.php @@ -124,11 +124,11 @@ class ArticleLoader extends Storm_Model_Loader { return $this; } - if (10 == strlen($event_date)) { + if (10 == strlen($event_date)) { // si on donne une date YYYY-MM-DD $this->_select->where('EVENTS_DEBUT <= ?', $event_date); $this->_select->where('EVENTS_FIN >= ?', $event_date); - } else { + } else { // si on donne une date sur le mois YYYY-MM $this->_select->where('left(EVENTS_DEBUT,7) <= ?', $event_date); $this->_select->where('left(EVENTS_FIN,7) >= ?', $event_date); diff --git a/tests/application/modules/opac/controllers/AbonneControllerMultimediaTest.php b/tests/application/modules/opac/controllers/AbonneControllerMultimediaTest.php index 99f2539677a11a86899e4cb8b02a90195031beee..2ff7419218d8df02863609ffa038b0d2db4e2904 100644 --- a/tests/application/modules/opac/controllers/AbonneControllerMultimediaTest.php +++ b/tests/application/modules/opac/controllers/AbonneControllerMultimediaTest.php @@ -716,7 +716,7 @@ class AbonneControllerMultimediaHoldHoursTest extends AbonneControllerMultimedia $this->_prepareLocationInSession(); $this->_prepareDayInSession(); - Class_Multimedia_Location::setTimeSource((new TimeSourceForTest())->setTime(strtotime('2012-09-12 09:00:00'))); + Class_Multimedia_Location::setTimeSource(new TimeSourceForTest('2012-09-12 09:00:00')); $this->dispatch('/abonne/multimedia-hold-hours', true); } diff --git a/tests/library/Class/TimeSourceForTest.php b/tests/library/Class/TimeSourceForTest.php index bb475147f6fc114cbddbbae2e51055d0e7f29bca..8877e6da6b390132ab5ef5cbbcd9bd1282b871c5 100644 --- a/tests/library/Class/TimeSourceForTest.php +++ b/tests/library/Class/TimeSourceForTest.php @@ -22,6 +22,10 @@ class TimeSourceForTest extends Class_TimeSource { protected $_time; + public function __construct($strtime) { + $this->setTime(strtotime($strtime)); + } + /** * @param $time timestamp */