wordpress-develop/tests/phpunit/tests/post
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
..
attachments.php Tests: Convert the checks for imagejpeg() function availability to use the @requires annotation. 2020-09-21 11:34:06 +00:00
bodyClass.php Coding Standards: Replace alias PHP functions with the canonical names. 2020-10-18 17:25:10 +00:00
filtering.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
formats.php Build/Test Tools: Replace assertInternalType() usage in unit tests. 2021-07-05 17:21:53 +00:00
getBodyClass.php PHPCS: Fix WPCS violation in [45088]. 2019-04-01 16:48:32 +00:00
getLastPostDate.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
getLastPostModified.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
getPageByPath.php Build/Test Tools: Replace assertInternalType() usage in unit tests. 2021-07-05 17:21:53 +00:00
getPageChildren.php Tests: Introduce assertSameSets() and assertSameSetsWithIndex(), and use them where appropriate. 2020-09-04 07:01:00 +00:00
getPages.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
getPageUri.php Tests: Rename some files and classes in phpunit/tests/post/ per the naming conventions. 2020-10-27 16:07:21 +00:00
getPostClass.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
getPosts.php Code is Poetry. 2017-11-30 23:09:33 +00:00
getPostsByAuthorSql.php Code is Poetry. 2017-11-30 23:09:33 +00:00
getPostStatus.php Media: Ensure get_post_status() returns correct result for attachments. 2021-01-20 04:39:24 +00:00
getPostTypeLabels.php Build/Test Tools: Replace assertInternalType() usage in unit tests. 2021-07-05 17:21:53 +00:00
getTheContent.php Posts, Post Types: Avoid a PHP warning when get_the_content() is called outside of the loop. 2020-06-21 10:34:35 +00:00
getTheExcerpt.php Posts: Avoid the use of globals in get_the_content() and related functions. 2019-03-20 15:48:46 +00:00
isPostPubliclyViewable.php Posts, Post Types: Additional functions to check if a post is publicly viewable. 2021-02-01 23:31:54 +00:00
isPostStatusViewable.php Posts, Post Types: Additional functions to check if a post is publicly viewable. 2021-02-01 23:31:54 +00:00
isPostTypeViewable.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:50:26 +00:00
meta.php Build/Test Tools: Replace assertInternalType() usage in unit tests. 2021-07-05 17:21:53 +00:00
nav-menu.php Tests: Use assertSame() in some newly introduced tests. 2021-02-10 13:24:24 +00:00
objects.php Build/Test Tools: Replace assertInternalType() usage in unit tests. 2021-07-05 17:21:53 +00:00
output.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
pings.php Tests: Rename some files and classes in phpunit/tests/post/ per the naming conventions. 2020-10-27 16:07:21 +00:00
postClass.php Coding Standards: Replace alias PHP functions with the canonical names. 2020-10-18 17:25:10 +00:00
query.php Build/Test Tools: Replace assertInternalType() usage in unit tests. 2021-07-05 17:21:53 +00:00
revisions.php Tests: Use more appropriate assertions in a few tests. 2021-06-22 04:34:29 +00:00
slashes.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
template.php Posts, Post Types: Rename the new post parent conditional tag functions for clarity. 2021-02-20 17:43:55 +00:00
thumbnails.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
types.php Build/Test Tools: Replace assertInternalType() usage in unit tests. 2021-07-05 17:21:53 +00:00
walkerPage.php Menus: In Walker_Nav_Menu, Walker_Category, and Walker_Page, properly output link attributes having a legitimate "empty" value, for example an HTML data attribute with a value of zero (0). 2019-10-06 15:04:18 +00:00
wpAfterInsertPost.php REST API: Pass the previous state of the post as a parameter to the wp_after_insert_post hook. 2020-12-01 20:45:43 +00:00
wpGetPostParentId.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
wpInsertPost.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
wpListPages.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
wpPost.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
wpPostType.php Tests: Rename some files and classes in phpunit/tests/post/ per the naming conventions. 2020-10-27 16:07:21 +00:00
wpPublishPost.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
wpUniquePostSlug.php Tests: Rename some files and classes in phpunit/tests/post/ per the naming conventions. 2020-10-27 16:07:21 +00:00