diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-11-21 06:52:24 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-11-21 06:52:24 +0400 |
commit | fd73dc735aabe28684d2243ad348481aa69bd85e (patch) | |
tree | 18f892178699a98ff752e19745d95be769f32c82 | |
parent | c6945b8bceb9eb56e2d72ff98f7f9a07b7bc0ebe (diff) |
write (again) processed files after they were cleaned up
-rwxr-xr-x | tests/PHPUnit/IntegrationTestCase.php | 17 |
1 files 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</revenue>', '</revenue>', $expected); $response = str_replace('.11</revenue>', '</revenue>', $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); - } } } |