From b8a2bc1ec101f49bb69d795743d9a9b1a3f447e0 Mon Sep 17 00:00:00 2001
From: pbarroca <pbarroca@afi-sa.fr>
Date: Fri, 20 Apr 2018 10:33:50 +0200
Subject: [PATCH] dev #73934  :  try to fix failure

---
 ...t.php => PhaseNoticeBibliondemandTest.php} | 10 ++--
 .../PhasePrepareIntegrationsTest.php          | 50 ++++++++++---------
 2 files changed, 32 insertions(+), 28 deletions(-)
 rename tests/library/Class/Cosmogramme/Integration/{RecordPhaseBibliondemandTest.php => PhaseNoticeBibliondemandTest.php} (95%)

diff --git a/tests/library/Class/Cosmogramme/Integration/RecordPhaseBibliondemandTest.php b/tests/library/Class/Cosmogramme/Integration/PhaseNoticeBibliondemandTest.php
similarity index 95%
rename from tests/library/Class/Cosmogramme/Integration/RecordPhaseBibliondemandTest.php
rename to tests/library/Class/Cosmogramme/Integration/PhaseNoticeBibliondemandTest.php
index ba351e6c95e..af82ba170a6 100644
--- a/tests/library/Class/Cosmogramme/Integration/RecordPhaseBibliondemandTest.php
+++ b/tests/library/Class/Cosmogramme/Integration/PhaseNoticeBibliondemandTest.php
@@ -22,7 +22,7 @@
 require_once('cosmogramme/php/fonctions/variables.php');
 require_once(__DIR__.'/PhaseNoticeTestCase.php');
 
-abstract class AbstractRecordPhaseBibliondemandTestCase extends PhaseNoticeTestCase {
+abstract class PhaseNoticeBibliondemandTestCase extends PhaseNoticeTestCase {
   protected $_storm_default_to_volatile = true;
 
   protected function _prepareFixtures() {
@@ -94,7 +94,7 @@ abstract class AbstractRecordPhaseBibliondemandTestCase extends PhaseNoticeTestC
 
 
 
-class RecordPhaseBibliondemandSimpleTest extends AbstractRecordPhaseBibliondemandTestCase {
+class PhaseNoticeBibliondemandSimpleTest extends PhaseNoticeBibliondemandTestCase {
   /** @test */
   public function logShouldNotContainsError() {
     $this->assertNotLogContains('Erreur');
@@ -229,7 +229,7 @@ class RecordPhaseBibliondemandSimpleTest extends AbstractRecordPhaseBibliondeman
 
 
 
-class RecordPhaseBibliondemandUpdateTest extends AbstractRecordPhaseBibliondemandTestCase {
+class PhaseNoticeBibliondemandUpdateTest extends PhaseNoticeBibliondemandTestCase {
   public function _prepareFixtures() {
     parent::_prepareFixtures();
 
@@ -279,7 +279,7 @@ class RecordPhaseBibliondemandUpdateTest extends AbstractRecordPhaseBibliondeman
 
 
 
-class RecordPhaseBibliondemandSimpleFileTest extends RecordPhaseBibliondemandSimpleTest {
+class PhaseNoticeBibliondemandSimpleFileTest extends PhaseNoticeBibliondemandSimpleTest {
 
   protected function _prepareIntegration() {
     Class_Cosmogramme_Integration::find(888)
@@ -291,7 +291,7 @@ class RecordPhaseBibliondemandSimpleFileTest extends RecordPhaseBibliondemandSim
 
 
 
-class RecordPhaseBibliondemandUpdateFileTest extends RecordPhaseBibliondemandUpdateTest {
+class PhaseNoticeBibliondemandUpdateFileTest extends PhaseNoticeBibliondemandUpdateTest {
 
   protected function _prepareIntegration() {
     Class_Cosmogramme_Integration::find(888)
diff --git a/tests/library/Class/Cosmogramme/Integration/PhasePrepareIntegrationsTest.php b/tests/library/Class/Cosmogramme/Integration/PhasePrepareIntegrationsTest.php
index fd524be7fbe..62a1a3a5d8e 100644
--- a/tests/library/Class/Cosmogramme/Integration/PhasePrepareIntegrationsTest.php
+++ b/tests/library/Class/Cosmogramme/Integration/PhasePrepareIntegrationsTest.php
@@ -19,40 +19,41 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
  */
 
-abstract class PhasePrepareIntegrationsWithOAITestCase extends Class_Cosmogramme_Integration_PhaseTestCase {
+abstract class PhasePrepareIntegrationsWithOAITestCase
+  extends Class_Cosmogramme_Integration_PhaseTestCase {
+
   protected $_http_client;
 
   public function setUp() {
     parent::setUp();
 
-    $file_system = Storm_Test_ObjectWrapper::mock();
-    $file_system
-      ->whenCalled('is_file')
-      ->with ('ftp/my-library.net/transferts/foo/mylibrarytotal.txt')
-      ->answers(true)
+    $file_system = $this->mock()
+                        ->whenCalled('is_file')
+                        ->with ('ftp/my-library.net/transferts/foo/mylibrarytotal.txt')
+                        ->answers(true)
 
-      ->whenCalled('is_file')
-      ->with ('ftp/my-library.net/transferts/foo/mylibraryincr.txt')
-      ->answers(false)
+                        ->whenCalled('is_file')
+                        ->with ('ftp/my-library.net/transferts/foo/mylibraryincr.txt')
+                        ->answers(false)
 
-      ->whenCalled('opendir')
-      ->with ('ftp/my-library.net/transferts/foo/')
-      ->answers('dir_pointer')
+                        ->whenCalled('opendir')
+                        ->with ('ftp/my-library.net/transferts/foo/')
+                        ->answers('dir_pointer')
 
 
-      ->whenCalled('readdir')
-      ->with ('dir_pointer')
-      ->answers('mylibraryincr.txt')
+                        ->whenCalled('readdir')
+                        ->with ('dir_pointer')
+                        ->answers('mylibraryincr.txt')
 
-      ->whenCalled('closedir')
-      ->with ('dir_pointer')
-      ->answers(true)
+                        ->whenCalled('closedir')
+                        ->with ('dir_pointer')
+                        ->answers(true)
 
-      ->whenCalled('rename')
-      ->with('ftp/my-library.net/transferts/foo/mylibrarytotal.txt',
-             'ftp/my-library.net/integration/integre1179.pan')
-      ->answers(true)
-      ->beStrict();
+                        ->whenCalled('rename')
+                        ->with('ftp/my-library.net/transferts/foo/mylibrarytotal.txt',
+                               'ftp/my-library.net/integration/integre1179.pan')
+                        ->answers(true)
+                        ->beStrict();
 
     $this->_http_client = $this->mock()
                                ->whenCalled('postData')
@@ -73,6 +74,9 @@ abstract class PhasePrepareIntegrationsWithOAITestCase extends Class_Cosmogramme
 
   public function tearDown() {
     Class_Systeme_Report_Publication::resetHttpClient();
+    Class_Cosmogramme_Integration_PhasePrepareIntegrations::setFileSystem(null);
+    Class_Cosmogramme_Integration_PhasePrepareIntegrations::setTimeSource(null);
+
     parent::tearDown();
   }
 
-- 
GitLab