diff --git a/core/DataTable/Renderer.php b/core/DataTable/Renderer.php index c9c4183c4c4d6fd99ce29e44dec1a44666759a94..6fd073d5fbd751e48a7f6d3093fdadf0aa71b909 100644 --- a/core/DataTable/Renderer.php +++ b/core/DataTable/Renderer.php @@ -97,8 +97,7 @@ abstract class Piwik_DataTable_Renderer 'csv', 'tsv', 'html', - 'php', - 'original' + 'php' ); static public function getRenderers() diff --git a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getGoldenRatio.xml b/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getGoldenRatio.xml deleted file mode 100644 index f74b9ec866dd2c47a8861322c4f3d545946616e5..0000000000000000000000000000000000000000 --- a/plugins/ExampleAPI/tests/expected/test_allGetMethods__ExampleAPI.getGoldenRatio.xml +++ /dev/null @@ -1,2 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<result>1.61803398875</result> \ No newline at end of file diff --git a/tests/integration/Integration.php b/tests/integration/Integration.php index a43983387a7aa80c020b1bfc2154afe0c405d2d2..d7294752172a4865affeedb270deffce2f620788 100644 --- a/tests/integration/Integration.php +++ b/tests/integration/Integration.php @@ -287,7 +287,10 @@ abstract class Test_Integration extends Test_Database // $TEST_NAME - $API_METHOD $filename = $testName . '__' . $apiId; - $response = $request->process(); + // Cast as string is important. For example when calling + // with format=original, objects or php arrays can be returned. + // we also hide errors to prevent the 'headers already sent' in the ResponseBuilder (which sends Excel headers multiple times eg.) + $response = (string)@$request->process(); file_put_contents( $pathProcessed . $filename, $response ); $expected = file_get_contents( $pathExpected . $filename); @@ -295,10 +298,16 @@ abstract class Test_Integration extends Test_Database { $this->fail(" ERROR: Could not find set of 'expected' files. For new tests, to pass the test, you can copy files from /processed into $pathExpected after checking the output is valid."); } - $this->assertEqual($response, $expected, "In $filename, %s"); + // When tests run on Windows EOL delimiters are not the same as UNIX default EOL used in the renderers + $expected = str_replace("\r\n", "\n", $expected); + $this->assertEqual(trim($response), trim($expected), "In $filename, %s"); if($response != $expected){ - echo $apiId; - var_dump($response); + echo 'ERROR FOR' . $apiId . ' -- FETCHED RESPONSE, EXPECTED RESPONSE'; + echo "\n"; + echo ($response); + echo "\n"; + echo ($expected); + echo "\n"; } } $this->pass();