From fd73dc735aabe28684d2243ad348481aa69bd85e Mon Sep 17 00:00:00 2001 From: mattab Date: Thu, 21 Nov 2013 15:52:24 +1300 Subject: write (again) processed files after they were cleaned up --- tests/PHPUnit/IntegrationTestCase.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/tests/PHPUnit/IntegrationTestCase.php b/tests/PHPUnit/IntegrationTestCase.php index 030a4cff93..cb3730577d 100755 --- a/tests/PHPUnit/IntegrationTestCase.php +++ b/tests/PHPUnit/IntegrationTestCase.php @@ -725,15 +725,16 @@ abstract class IntegrationTestCase extends PHPUnit_Framework_TestCase } $response = $this->normalizePdfContent($response); - if (empty($compareAgainst)) { - file_put_contents($processedFilePath, $response); - } - $expected = $this->loadExpectedFile($expectedFilePath); $expectedContent = $expected; $expected = $this->normalizePdfContent($expected); if (empty($expected)) { + + if (empty($compareAgainst)) { + file_put_contents($processedFilePath, $response); + } + print("The expected file is not found at '$expectedFilePath'. The Processed response was:"); print("\n----------------------------\n\n"); var_dump($response); @@ -796,6 +797,8 @@ abstract class IntegrationTestCase extends PHPUnit_Framework_TestCase $expected = str_replace('.11', '', $expected); $response = str_replace('.11', '', $response); + file_put_contents($processedFilePath, $response); + try { if (strpos($requestUrl, 'format=xml') !== false) { $this->assertXmlStringEqualsXmlString($expected, $response, "Differences with expected in: $processedFilePath"); @@ -807,18 +810,12 @@ abstract class IntegrationTestCase extends PHPUnit_Framework_TestCase if (trim($response) == trim($expected) && empty($compareAgainst) ) { - file_put_contents($processedFilePath, $response); - if(trim($expectedContent) != trim($expected)) { file_put_contents($expectedFilePath, $expected); } } } catch (Exception $ex) { $this->comparisonFailures[] = $ex; - - if (!empty($compareAgainst)) { - file_put_contents($processedFilePath, $response); - } } } -- cgit v1.2.3