diff --git a/library/Class/Cosmogramme/Integration/PhaseReviews.php b/library/Class/Cosmogramme/Integration/PhaseReviews.php index d617e93d65adf1d6a2d8b2ecfa542ca729dd0b53..7f2c917b534bc770b5788fa17b68b61a5398be66 100644 --- a/library/Class/Cosmogramme/Integration/PhaseReviews.php +++ b/library/Class/Cosmogramme/Integration/PhaseReviews.php @@ -28,11 +28,28 @@ class Class_Cosmogramme_Integration_PhaseReviews extends Class_Cosmogramme_Integ public function __construct($phase, $log, $chrono) { parent::__construct($phase, $log, $chrono); $this->_previous_records = []; + + } + + + protected function _init($new_phase) { + + $new_phase + ->resetDatas() + ->setData('nombre', 0) + ->setData('pointeur_notice', 0) + ->setData('pointeur', + $last_update_date ? $last_update_date : '0000-00-00 00:00:00'); + + $this->_chrono + ->startOnFile() + ->startOnRecords(); } - protected function _init($new_phase) {} public function _execute() { + xdebug_break(); + $this->_setData('pointeur_notice', 0); while ($records = Class_AvisNotice::findAllAfter($this->_getData('pointeur_notice'))) { if (0 == ($this->_getData('nombre') % 100)) diff --git a/tests/library/Class/Cosmogramme/Integration/PhaseReviewsTest.php b/tests/library/Class/Cosmogramme/Integration/PhaseReviewsTest.php index 4569501bcee6b78ba184a43acfbfb1eb8ffe79c4..ce21f084dc5f5cf0698a580ecf92ba759b41476b 100644 --- a/tests/library/Class/Cosmogramme/Integration/PhaseReviewsTest.php +++ b/tests/library/Class/Cosmogramme/Integration/PhaseReviewsTest.php @@ -106,4 +106,8 @@ class PhaseReviewsExpectedPreviousPhaseTest extends PhaseReviewsTestCase { $this->assertLogContains('1 avis traités'); } +/** @test */ + public function noticeMilleniumShouldBeAttached() { + $this->assertEquals(816,Class_AvisNotice::find(13)->getIdNotice()); + } }