diff options
author | Matthieu Aubry <mattab@users.noreply.github.com> | 2017-01-26 04:54:41 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-26 04:54:41 +0300 |
commit | 0a81489d4051fa71df0f589c298ffb94383938b9 (patch) | |
tree | 1c2a12c8ce20a995681dd3cffc3b818be12b198b /tests/PHPUnit | |
parent | c814ce7dc60a1851f9f65a50d422383ad2cc0993 (diff) |
Enable Scheduled reports with images in CI Tests + Fix build (#11269)
* Cross Domain: forward pk_vid parameter when the clicked element is not directly a link but is within the link <a> element itself
* Run scheduled reports with images on PHP 5.6
* Comment
* Replace today's date by placeholder in scheduled reports tests
* Travis runs GD 2.1.0
* Do not generate reports with images yet
it is broken refs https://github.com/piwik/piwik/issues/11276
Diffstat (limited to 'tests/PHPUnit')
5 files changed, 11 insertions, 4 deletions
diff --git a/tests/PHPUnit/Framework/Fixture.php b/tests/PHPUnit/Framework/Fixture.php index 131af64a0f..98292b366a 100644 --- a/tests/PHPUnit/Framework/Fixture.php +++ b/tests/PHPUnit/Framework/Fixture.php @@ -77,7 +77,7 @@ use ReflectionClass; class Fixture extends \PHPUnit_Framework_Assert { const IMAGES_GENERATED_ONLY_FOR_OS = 'linux'; - const IMAGES_GENERATED_FOR_PHP = '5.5'; + const IMAGES_GENERATED_FOR_PHP = '5.6'; const IMAGES_GENERATED_FOR_GD = '2.1.1'; const DEFAULT_SITE_NAME = 'Piwik test'; diff --git a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php index 746f4dbf0c..3048352b43 100755 --- a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php +++ b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php @@ -121,7 +121,7 @@ abstract class SystemTestCase extends PHPUnit_Framework_TestCase { if (!Fixture::canImagesBeIncludedInScheduledReports()) { $this->markTestSkipped( - 'Scheduled reports generated during integration tests will not contain the image graphs. ' . + '(This should not occur on Travis CI server as we expect these tests to run there). Scheduled reports generated during integration tests will not contain the image graphs. ' . 'For tests to generate images, use a machine with the following specifications : ' . 'OS = '.Fixture::IMAGES_GENERATED_ONLY_FOR_OS.', PHP = '.Fixture::IMAGES_GENERATED_FOR_PHP . ' and GD = ' . Fixture::IMAGES_GENERATED_FOR_GD diff --git a/tests/PHPUnit/Framework/TestRequest/Response.php b/tests/PHPUnit/Framework/TestRequest/Response.php index cc5b682be2..5969725de7 100644 --- a/tests/PHPUnit/Framework/TestRequest/Response.php +++ b/tests/PHPUnit/Framework/TestRequest/Response.php @@ -112,6 +112,7 @@ class Response $apiResponse = $this->normalizePdfContent($apiResponse); $apiResponse = $this->removeXmlFields($apiResponse); + $apiResponse = $this->removeTodaysDate($apiResponse); $apiResponse = $this->normalizeDecimalFields($apiResponse); $apiResponse = $this->normalizeEncodingPhp533($apiResponse); $apiResponse = $this->normalizeSpaces($apiResponse); @@ -120,6 +121,11 @@ class Response return $apiResponse; } + private function removeTodaysDate($apiResponse) + { + return str_replace(date('Y-m-d'), 'today-date-removed-in-tests', $apiResponse); + } + private function normalizeEncodingPhp533($apiResponse) { return str_replace('&#039;', "'", $apiResponse); @@ -175,6 +181,7 @@ class Response $response = preg_replace('/\(D:[0-9]{14}/', '(D:19700101000000', $response); $response = preg_replace('/\/ID \[ <.*> ]/', '', $response); $response = preg_replace('/\/id:\[ <.*> ]/', '', $response); + $response = $this->removeXmlElement($response, "xmp:CreateDate"); $response = $this->removeXmlElement($response, "xmp:ModifyDate"); $response = $this->removeXmlElement($response, "xmp:MetadataDate"); diff --git a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html index 86fa5492ac..cdbadbaa2a 100644 --- a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html +++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html @@ -19,7 +19,7 @@ </a> </td> <td align="right"> - <a style="font-size:16px; padding:0 15px; color:#ffffff" title="View Web Analytics reports for Site 1." target="_blank" href="http://example.com/piwik/tests/PHPUnit/proxy/index.php?module=CoreHome&action=index&idSite=1&period=day&date=2017-01-22"> + <a style="font-size:16px; padding:0 15px; color:#ffffff" title="View Web Analytics reports for Site 1." target="_blank" href="http://example.com/piwik/tests/PHPUnit/proxy/index.php?module=CoreHome&action=index&idSite=1&period=day&date=today-date-removed-in-tests"> Dashboard </a> </td> diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html index 1d14d55eab..66ae5338cf 100644 --- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html +++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html @@ -19,7 +19,7 @@ </a> </td> <td align="right"> - <a style="font-size:16px; padding:0 15px; color:#ffffff" title="View Web Analytics reports for Piwik test." target="_blank" href="http://example.com/piwik/tests/PHPUnit/proxy/index.php?module=CoreHome&action=index&idSite=1&period=day&date=2017-01-22"> + <a style="font-size:16px; padding:0 15px; color:#ffffff" title="View Web Analytics reports for Piwik test." target="_blank" href="http://example.com/piwik/tests/PHPUnit/proxy/index.php?module=CoreHome&action=index&idSite=1&period=day&date=today-date-removed-in-tests"> Dashboard </a> </td> |