woocommerce/tests/unit-tests/util
Rodrigo Primo 793dba81f1 Fix failing unit test
This commit fixes the unit test
WC_Tests_API_Functions::test_wc_rest_upload_image_from_url_should_return_error_when_invalid_image_is_passed() which was failing due to a change in a WordPress core message with the following error:

```
2) WC_Tests_API_Functions::test_wc_rest_upload_image_from_url_should_return_error_when_invalid_image_is_passed

Failed asserting that two strings are equal.

--- Expected

+++ Actual

@@ @@

-'Invalid image: File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.'

+'Invalid image: File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini file or by post_max_size being defined as smaller than upload_max_filesize in php.ini.'

/home/travis/build/woocommerce/woocommerce/tests/unit-tests/util/api-functions.php:89
```

(https://travis-ci.org/woocommerce/woocommerce/jobs/637353161#L402)

This test only fails when using WordPress nightly build (the yet to be
released WP 5.4).

To fix this problem, this commit adds an if statement to check for different error
messages depending on the WordPress version that is being used to run
the tests. In the future, we might want to refactor this test to remove
its dependency to a WordPress error message to make it more robust and
stable.
2020-01-15 11:17:49 -03:00
..
api-functions.php Fix failing unit test 2020-01-15 11:17:49 -03:00
class-wc-rate-limiter.php Fix Generic.Formatting.MultipleStatementAlignment violations 2019-12-20 14:21:08 -03:00
class-wc-tests-core-functions.php Fix WordPress.DateTime.CurrentTimeTimestamp vilations 2019-12-20 14:23:05 -03:00
class-wc-tests-user-functions.php Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00
class-wc-tests-wc-query.php Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00
conditional-functions.php Introduce file type check for tax rate importer 2019-07-02 10:44:21 -03:00
deprecated-hooks.php Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00
dummy-wc-logger.php Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00
install.php Merge branch 'master' into feature/product-custom-tables-supporting-changes 2018-06-13 10:18:38 +01:00
notice-functions.php Improve wc_print_notices() test coverage 2019-12-03 15:29:10 -03:00
plugin-updates.php Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00
validation.php Add postcode validation for Slovenia (#25174) 2019-12-09 10:09:45 -03:00