From 02c866086ed81fc247fc6bd9f85b6ada65c8f86c Mon Sep 17 00:00:00 2001 From: efalcy <efalcy@afi-sa.fr> Date: Thu, 1 Oct 2015 19:30:01 +0200 Subject: [PATCH] hotline #23808 : avis , add tests for phase reviews on cosmogramme --- .../Cosmogramme/Integration/PhaseReviews.php | 19 ++++++++++++++++++- .../Integration/PhaseReviewsTest.php | 4 ++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/library/Class/Cosmogramme/Integration/PhaseReviews.php b/library/Class/Cosmogramme/Integration/PhaseReviews.php index d617e93d65a..7f2c917b534 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 4569501bcee..ce21f084dc5 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()); + } } -- GitLab