@sgiehl opened this Pull Request on January 27th 2021 Member

Description:

On PHP 8 the sms report test are failing:

1) Piwik\Plugins\Ecommerce\tests\System\EcommerceOrderWithItemsTest::testApi with data set <a href='/43'>#43</a> ('ScheduledReports.generateReport', array('_schedrep_via_sms_one_site', '2011-04-05 00:11:42', array('week'), 'original', 'sms.txt', array(2, 4, 0)))
Piwik\Plugins\Ecommerce\tests\System\EcommerceOrderWithItemsTest: Differences with expected in '/home/travis/build/matomo-org/matomo/plugins/Ecommerce/tests/System/processed/test_ecommerceOrderWithItems_schedrep_via_sms_one_site__ScheduledReports.generateReport_week.original.sms.txt'
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'week April 4 – 10, 2011. 5 Visits (+100%), 16 Actions (+100%), Revenue: $130 (+100%), 5 Goal conversions (+100%), Product Revenue: $130 (+100%), 4 Ecommerce Orders (+100%)'
+'week April 4 – 10, 2011. 5 Visits (+-100%), 16 Actions (+-100%), Revenue: $130 (+-100%), 5 Goal conversions (+-100%), Product Revenue: $130 (+-100%), 4 Ecommerce Orders (+-100%)'

While digging deeper into the failure I realized that the numbers are actually formatted twice. As there are some numeric checks in the sms template we actually can't format the metrics before. That used to work for PHP 7, but it doesn't for PHP 8. Formatting in the template only should be enough nevertheless.

I've tested those changes on another branch where tests are running against PHP 8. See https://travis-ci.com/github/matomo-org/matomo/jobs/475638482

Review

  • [ ] Functional review done
  • [ ] Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
  • [ ] Security review done see checklist
  • [ ] Code review done
  • [ ] Tests were added if useful/possible
  • [ ] Reviewed for breaking changes
  • [ ] Developer changelog updated if needed
  • [ ] Documentation added if needed
  • [ ] Existing documentation updated if needed
This Pull Request was closed on January 28th 2021
Powered by GitHub Issue Mirror