wordpress-develop/tests/phpunit/tests/rest-api
Sergey Biryukov bca693b190 Build/Test Tools: Replace assertInternalType() usage in unit tests.
The `assertInternalType()` and `assertNotInternalType()` methods are 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:

* `assertIsArray()`
* `assertIsBool()`
* `assertIsFloat()`
* `assertIsInt()`
* `assertIsNumeric()`
* `assertIsObject()`
* `assertIsResource()`
* `assertIsString()`
* `assertIsScalar()`
* `assertIsCallable()`
* `assertIsIterable()`
* `assertIsNotArray()`
* `assertIsNotBool()`
* `assertIsNotFloat()`
* `assertIsNotInt()`
* `assertIsNotNumeric()`
* `assertIsNotObject()`
* `assertIsNotResource()`
* `assertIsNotString()`
* `assertIsNotScalar()`
* `assertIsNotCallable()`
* `assertIsNotIterable()`

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

Props pbearne, jrf, dd32, SergeyBiryukov.
Fixes #53491. See #46149.

git-svn-id: https://develop.svn.wordpress.org/trunk@51331 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-05 17:21:53 +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 Build/Test Tools: Replace assertInternalType() usage in unit tests. 2021-07-05 17:21:53 +00:00
rest-autosaves-controller.php Build/Test Tools: Misc test enhancements. 2020-11-15 17:17:55 +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 Build/Test Tools: Fix and standardise calls to the setUp() and setUpBeforeClass() methods in the test suite. 2021-02-27 16:54:52 +00:00
rest-block-type-controller.php Editor: Make block type aware of variations 2021-03-12 13:33:21 +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 Build/Test Tools: Remove redundant teardown functionality from individual tests which is already covered in the base teardown method. 2021-03-01 18:42:49 +00:00
rest-comments-controller.php Build/Test Tools: Replace assertInternalType() usage in unit tests. 2021-07-05 17:21:53 +00:00
rest-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-pages-controller.php Build/Test Tools: Remove redundant teardown functionality from individual tests which is already covered in the base teardown method. 2021-03-01 18:42:49 +00:00
rest-pattern-directory-controller.php Block Editor: Move caching to endpoint for unique responses. 2021-06-22 21:23:19 +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: Introduce assertSameSets() and assertSameSetsWithIndex(), and use them where appropriate. 2020-09-04 07:01:00 +00:00
rest-post-types-controller.php Tests: Introduce assertSameSets() and assertSameSetsWithIndex(), and use them where appropriate. 2020-09-04 07:01:00 +00:00
rest-posts-controller.php Tests: Use assertSameSets() in some newly introduced tests. 2021-06-10 19:18:15 +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 Build/Test Tools: Replace assertInternalType() usage in unit tests. 2021-07-05 17:21:53 +00:00
rest-revisions-controller.php Build/Test Tools: Remove redundant teardown functionality from individual tests which is already covered in the base teardown method. 2021-03-01 18:42:49 +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 Block Editor: Add support for the pattern directory. 2021-05-26 01:10:57 +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 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-server.php Build/Test Tools: Replace assertInternalType() usage in unit tests. 2021-07-05 17:21:53 +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 Coding Standards: Add missing visibility keywords to WP_Theme, WP_Theme_JSON, and WP_Theme_JSON_Resolver tests. 2021-06-30 18:21:52 +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 Build/Test Tools: Remove redundant teardown functionality from individual tests which is already covered in the base teardown method. 2021-03-01 18:42:49 +00:00
rest-taxonomies-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-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 assertSameSets() in some newly introduced tests. 2021-06-10 19:18:15 +00:00
rest-users-controller.php Build/Test Tools: Replace assertInternalType() usage in unit tests. 2021-07-05 17:21:53 +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 REST API: Allow multiple widgets to be deleted in a single batch request. 2021-06-30 10:40:21 +00:00