wordpress-develop/tests/phpunit/tests/rest-api
Sergey Biryukov c70fe62ed1 Tests: Replace assertContains() with assertStringContainsString() when used with strings.
Using the `assertContains()` and `assertNotContains()` methods with string haystacks was deprecated in PHPUnit 8 and removed in PHPUnit 9.

While WordPress test suite currently only supports PHPUnit up to 7.5.x, this allows us to switch to newer assertions ahead of adding full support for PHPUnit 8+.

These methods introduced in PHPUnit 7.5 should be used as an alternative:

* `assertStringContainsString()`
* `assertStringContainsStringIgnoringCase`
* `assertStringNotContainsString()`
* `assertStringNotContainsStringIgnoringCase`

As WordPress currently uses PHPUnit 5.7.x to run tests on PHP 5.6, polyfills for these methods were added to the `WP_UnitTestCase` class for PHPUnit < 7.5.

Follow-up to [51331], [51451], [51461].

Props jrf, dd32, SergeyBiryukov.
See #53363, #46149.

git-svn-id: https://develop.svn.wordpress.org/trunk@51462 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-19 14:00:11 +00:00
..
json_schema_test_suite REST API: Add support for the oneOf and anyOf keywords. 2020-10-20 18:22:39 +00:00
application-passwords.php App Passwords: Improve validation and sanitization of the application name. 2021-01-27 19:03:42 +00:00
rest-application-passwords-controller.php Build/Test Tools: Fix and standardise calls to the tearDown() method in the test suite. 2021-02-27 17:08:26 +00:00
rest-attachments-controller.php Tests: Replace assertContains() with assertStringContainsString() when used with strings. 2021-07-19 14:00:11 +00:00
rest-autosaves-controller.php Tests: Use more appropriate assertions in various tests. 2021-07-07 10:32:56 +00:00
rest-block-directory-controller.php Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00
rest-block-renderer-controller.php Tests: Replace assertContains() with assertStringContainsString() when used with strings. 2021-07-19 14:00:11 +00:00
rest-block-type-controller.php Tests: Use more appropriate assertions in various tests. 2021-07-07 10:32:56 +00:00
rest-blocks-controller.php Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00
rest-categories-controller.php Tests: Replace assertContains() with assertStringContainsString() when used with strings. 2021-07-19 14:00:11 +00:00
rest-comments-controller.php Tests: Replace assertContains() with assertStringContainsString() when used with strings. 2021-07-19 14:00:11 +00:00
rest-controller.php Tests: Use more appropriate assertions in various tests. 2021-07-18 14:10:24 +00:00
rest-pages-controller.php Tests: Replace assertContains() with assertStringContainsString() when used with strings. 2021-07-19 14:00:11 +00:00
rest-pattern-directory-controller.php Tests: Use more appropriate assertions in various tests. 2021-07-19 13:29:45 +00:00
rest-plugins-controller.php Build/Test Tools: Cleanup link-manager.zip after REST API tests are finished. 2021-04-01 20:39:56 +00:00
rest-post-meta-fields.php Build/Test Tools: Replace assertInternalType() usage in unit tests. 2021-07-05 17:21:53 +00:00
rest-post-statuses-controller.php Tests: Use more appropriate assertions in various tests. 2021-07-07 10:32:56 +00:00
rest-post-types-controller.php Tests: Use more appropriate assertions in various tests. 2021-07-10 11:15:44 +00:00
rest-posts-controller.php Tests: Replace assertContains() with assertStringContainsString() when used with strings. 2021-07-19 14:00:11 +00:00
rest-request-validation.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
rest-request.php Tests: Use more appropriate assertions in various tests. 2021-07-12 10:35:44 +00:00
rest-revisions-controller.php Tests: Replace assertContains() with assertStringContainsString() when used with strings. 2021-07-19 14:00:11 +00:00
rest-schema-sanitization.php REST API: Add support for the oneOf and anyOf keywords. 2020-10-20 18:22:39 +00:00
rest-schema-setup.php Tests: Use more appropriate assertions in various tests. 2021-07-11 12:41:48 +00:00
rest-schema-validation.php REST API: Correct enum validation for numeric values. 2021-04-04 18:05:10 +00:00
rest-search-controller.php Tests: Use more appropriate assertions in various tests. 2021-07-07 10:32:56 +00:00
rest-server.php Tests: Use more appropriate assertions in various tests. 2021-07-10 11:15:44 +00:00
rest-settings-controller.php Block Editor: Add the Site Logo block's server implementation. 2021-06-08 08:26:23 +00:00
rest-sidebars-controller.php Widgets: Use wp_sidebar_description() to retrieve a sidebar’s description. 2021-07-12 19:02:53 +00:00
rest-site-health-controller.php Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00
rest-tags-controller.php Tests: Replace assertContains() with assertStringContainsString() when used with strings. 2021-07-19 14:00:11 +00:00
rest-taxonomies-controller.php Tests: Use more appropriate assertions in various tests. 2021-07-10 11:15:44 +00:00
rest-templates-controller.php Tests: Use assertSame() in some newly introduced tests. 2021-06-07 11:16:29 +00:00
rest-term-meta-fields.php Build/Test Tools: Replace assertInternalType() usage in unit tests. 2021-07-05 17:21:53 +00:00
rest-test-controller.php REST API: Add support for the oneOf and anyOf keywords. 2020-10-20 18:22:39 +00:00
rest-themes-controller.php Tests: Use more appropriate assertions in various tests. 2021-07-10 11:15:44 +00:00
rest-users-controller.php Tests: Replace assertContains() with assertStringContainsString() when used with strings. 2021-07-19 14:00:11 +00:00
rest-widget-types-controller.php REST API: Retrieve latest widgets before loading sidebars. 2021-06-25 13:17:20 +00:00
rest-widgets-controller.php Tests: Use more appropriate assertions in various tests. 2021-07-07 10:32:56 +00:00