summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSergey Biryukov <sergeybiryukov@git.wordpress.org>2021-08-07 10:29:41 +0000
committerSergey Biryukov <sergeybiryukov@git.wordpress.org>2021-08-07 10:29:41 +0000
commitddb409edca5132d7aa73c2e45f166a5a915e2dbe (patch)
tree4b170a5bb4543b513fed90148d751e66c5acd408
parentcb6bf0263825f5f53b999a8a47786bbd79df29b2 (diff)
downloadwordpress-ddb409edca5132d7aa73c2e45f166a5a915e2dbe.tar.gz
wordpress-ddb409edca5132d7aa73c2e45f166a5a915e2dbe.zip
Build/Test Tools: Implement use of the `void` solution.
> PHPUnit 8.0.0 introduced a `void` return type declaration to the "fixture" methods – `setUpBeforeClass()`, `setUp()`, `tearDown()` and `tearDownAfterClass()`. As the `void` return type was not introduced until PHP 7.1, this makes it more difficult to create cross-version compatible tests when using fixtures, due to signature mismatches. > > The `Yoast\PHPUnitPolyfills\TestCases\TestCase` overcomes the signature mismatch by having two versions. The correct one will be loaded depending on the PHPUnit version being used. > > When using this TestCase, if an individual test, or another TestCase which extends this TestCase, needs to overload any of the "fixture" methods, it should do so by using a snake_case variant of the original fixture method name, i.e. `set_up_before_class()`, `set_up()`, `assert_pre_conditions()`, `assert_post_conditions()`, `tear_down()`, and `tear_down_after_class()`. > > The snake_case methods will automatically be called by PHPUnit. > > > IMPORTANT: The snake_case methods should not call the PHPUnit parent, i.e. do not use `parent::setUp()` from within an overloaded `set_up()` method. If necessary, DO call `parent::set_up()`. Reference: https://github.com/Yoast/PHPUnit-Polyfills#testcases This commit renames all declared fixture methods, and calls to parent versions of those fixture methods, from camelCase to snake_case. Follow-up to [51559-51567]. Props jrf, hellofromTonya, johnbillion, netweb, dd32, pputzer, SergeyBiryukov. See #46149. git-svn-id: https://develop.svn.wordpress.org/trunk@51568 602fd350-edb4-49c9-b593-d223f7449a82
-rw-r--r--tests/phpunit/includes/abstract-testcase.php14
-rw-r--r--tests/phpunit/includes/testcase-ajax.php12
-rw-r--r--tests/phpunit/includes/testcase-canonical.php4
-rw-r--r--tests/phpunit/includes/testcase-rest-controller.php8
-rw-r--r--tests/phpunit/includes/testcase-xmlrpc.php8
-rw-r--r--tests/phpunit/tests/admin/includesCommunityEvents.php4
-rw-r--r--tests/phpunit/tests/admin/includesListTable.php4
-rw-r--r--tests/phpunit/tests/admin/includesScreen.php4
-rw-r--r--tests/phpunit/tests/admin/includesTheme.php8
-rw-r--r--tests/phpunit/tests/adminbar.php4
-rw-r--r--tests/phpunit/tests/ajax/CustomizeManager.php8
-rw-r--r--tests/phpunit/tests/ajax/CustomizeMenus.php4
-rw-r--r--tests/phpunit/tests/ajax/DimComment.php4
-rw-r--r--tests/phpunit/tests/ajax/EditComment.php4
-rw-r--r--tests/phpunit/tests/ajax/ManageThemes.php8
-rw-r--r--tests/phpunit/tests/ajax/MediaEdit.php4
-rw-r--r--tests/phpunit/tests/ajax/PrivacyErasePersonalData.php8
-rw-r--r--tests/phpunit/tests/ajax/PrivacyExportPersonalData.php8
-rw-r--r--tests/phpunit/tests/ajax/ReplytoComment.php4
-rw-r--r--tests/phpunit/tests/ajax/Response.php8
-rw-r--r--tests/phpunit/tests/attachment/slashes.php4
-rw-r--r--tests/phpunit/tests/auth.php8
-rw-r--r--tests/phpunit/tests/block-template.php2
-rw-r--r--tests/phpunit/tests/blocks/context.php8
-rw-r--r--tests/phpunit/tests/blocks/editor.php8
-rw-r--r--tests/phpunit/tests/blocks/register.php4
-rw-r--r--tests/phpunit/tests/blocks/render.php4
-rw-r--r--tests/phpunit/tests/blocks/supportedStyles.php4
-rw-r--r--tests/phpunit/tests/blocks/wpBlock.php8
-rw-r--r--tests/phpunit/tests/blocks/wpBlockList.php8
-rw-r--r--tests/phpunit/tests/blocks/wpBlockTypeRegistry.php8
-rw-r--r--tests/phpunit/tests/bookmark/getBookmark.php4
-rw-r--r--tests/phpunit/tests/cache.php8
-rw-r--r--tests/phpunit/tests/canonical.php4
-rw-r--r--tests/phpunit/tests/canonical/customRules.php4
-rw-r--r--tests/phpunit/tests/canonical/https.php4
-rw-r--r--tests/phpunit/tests/canonical/noRewrite.php4
-rw-r--r--tests/phpunit/tests/canonical/pageOnFront.php4
-rw-r--r--tests/phpunit/tests/canonical/postStatus.php4
-rw-r--r--tests/phpunit/tests/canonical/sitemaps.php4
-rw-r--r--tests/phpunit/tests/category.php4
-rw-r--r--tests/phpunit/tests/category/getCategoryParents.php4
-rw-r--r--tests/phpunit/tests/category/walkerCategory.php4
-rw-r--r--tests/phpunit/tests/comment-submission.php4
-rw-r--r--tests/phpunit/tests/comment.php4
-rw-r--r--tests/phpunit/tests/comment/dateQuery.php4
-rw-r--r--tests/phpunit/tests/comment/getCommentAuthorEmailLink.php8
-rw-r--r--tests/phpunit/tests/comment/getCommentsPagesCount.php8
-rw-r--r--tests/phpunit/tests/comment/slashes.php4
-rw-r--r--tests/phpunit/tests/comment/walker.php4
-rw-r--r--tests/phpunit/tests/cron.php8
-rw-r--r--tests/phpunit/tests/customize/control.php8
-rw-r--r--tests/phpunit/tests/customize/custom-css-setting.php8
-rw-r--r--tests/phpunit/tests/customize/manager.php8
-rw-r--r--tests/phpunit/tests/customize/nav-menu-item-setting.php4
-rw-r--r--tests/phpunit/tests/customize/nav-menu-setting.php4
-rw-r--r--tests/phpunit/tests/customize/nav-menus.php4
-rw-r--r--tests/phpunit/tests/customize/panel.php8
-rw-r--r--tests/phpunit/tests/customize/partial.php8
-rw-r--r--tests/phpunit/tests/customize/section.php8
-rw-r--r--tests/phpunit/tests/customize/selective-refresh-ajax.php8
-rw-r--r--tests/phpunit/tests/customize/selective-refresh.php8
-rw-r--r--tests/phpunit/tests/customize/setting.php8
-rw-r--r--tests/phpunit/tests/customize/widgets.php8
-rw-r--r--tests/phpunit/tests/date/getFeedBuildDate.php4
-rw-r--r--tests/phpunit/tests/date/getPermalink.php4
-rw-r--r--tests/phpunit/tests/date/maybeDeclineDate.php8
-rw-r--r--tests/phpunit/tests/date/mysql2date.php4
-rw-r--r--tests/phpunit/tests/date/query.php4
-rw-r--r--tests/phpunit/tests/date/wpDate.php8
-rw-r--r--tests/phpunit/tests/db.php8
-rw-r--r--tests/phpunit/tests/db/charset.php4
-rw-r--r--tests/phpunit/tests/dbdelta.php12
-rw-r--r--tests/phpunit/tests/dependencies/scripts.php8
-rw-r--r--tests/phpunit/tests/dependencies/styles.php8
-rw-r--r--tests/phpunit/tests/feed/atom.php4
-rw-r--r--tests/phpunit/tests/feed/rss2.php4
-rw-r--r--tests/phpunit/tests/feed/wp-simplepie-file.php4
-rw-r--r--tests/phpunit/tests/file.php4
-rw-r--r--tests/phpunit/tests/filesystem/base.php8
-rw-r--r--tests/phpunit/tests/formatting/ExcerptRemoveBlocks.php8
-rw-r--r--tests/phpunit/tests/formatting/redirect.php4
-rw-r--r--tests/phpunit/tests/functions/deprecated.php8
-rw-r--r--tests/phpunit/tests/functions/doEnclose.php4
-rw-r--r--tests/phpunit/tests/functions/pluginBasename.php8
-rw-r--r--tests/phpunit/tests/functions/referer.php8
-rw-r--r--tests/phpunit/tests/functions/wpGetArchives.php4
-rw-r--r--tests/phpunit/tests/functions/wpListFilter.php4
-rw-r--r--tests/phpunit/tests/general/paginateLinks.php4
-rw-r--r--tests/phpunit/tests/general/template.php8
-rw-r--r--tests/phpunit/tests/general/wpError.php4
-rw-r--r--tests/phpunit/tests/general/wpGetArchives.php4
-rw-r--r--tests/phpunit/tests/general/wpGetDocumentTitle.php4
-rw-r--r--tests/phpunit/tests/general/wpResourceHints.php8
-rw-r--r--tests/phpunit/tests/hooks/doAction.php4
-rw-r--r--tests/phpunit/tests/http/base.php4
-rw-r--r--tests/phpunit/tests/http/wpGetHttpHeaders.php4
-rw-r--r--tests/phpunit/tests/https-detection.php4
-rw-r--r--tests/phpunit/tests/image/base.php4
-rw-r--r--tests/phpunit/tests/image/editor.php4
-rw-r--r--tests/phpunit/tests/image/editorGd.php8
-rw-r--r--tests/phpunit/tests/image/editorImagick.php8
-rw-r--r--tests/phpunit/tests/image/functions.php4
-rw-r--r--tests/phpunit/tests/image/header.php4
-rw-r--r--tests/phpunit/tests/image/intermediateSize.php4
-rw-r--r--tests/phpunit/tests/image/resize.php4
-rw-r--r--tests/phpunit/tests/image/resizeGd.php4
-rw-r--r--tests/phpunit/tests/image/resizeImagick.php4
-rw-r--r--tests/phpunit/tests/image/siteIcon.php8
-rw-r--r--tests/phpunit/tests/import/import.php4
-rw-r--r--tests/phpunit/tests/import/parser.php4
-rw-r--r--tests/phpunit/tests/import/postmeta.php4
-rw-r--r--tests/phpunit/tests/includes/factory.php4
-rw-r--r--tests/phpunit/tests/l10n/getUserLocale.php4
-rw-r--r--tests/phpunit/tests/l10n/loadTextdomain.php4
-rw-r--r--tests/phpunit/tests/l10n/loadTextdomainJustInTime.php8
-rw-r--r--tests/phpunit/tests/l10n/wpLocaleSwitcher.php8
-rw-r--r--tests/phpunit/tests/link/getAdjacentPostLink.php4
-rw-r--r--tests/phpunit/tests/locale.php4
-rw-r--r--tests/phpunit/tests/mail.php8
-rw-r--r--tests/phpunit/tests/media.php8
-rw-r--r--tests/phpunit/tests/menu/nav-menu.php4
-rw-r--r--tests/phpunit/tests/menu/walker-nav-menu-edit.php8
-rw-r--r--tests/phpunit/tests/menu/walker-nav-menu.php8
-rw-r--r--tests/phpunit/tests/meta.php4
-rw-r--r--tests/phpunit/tests/meta/slashes.php4
-rw-r--r--tests/phpunit/tests/multisite.php8
-rw-r--r--tests/phpunit/tests/multisite/cleanDirsizeCache.php8
-rw-r--r--tests/phpunit/tests/multisite/getSpaceAllowed.php8
-rw-r--r--tests/phpunit/tests/multisite/getSpaceUsed.php8
-rw-r--r--tests/phpunit/tests/multisite/isUploadSpaceAvailable.php8
-rw-r--r--tests/phpunit/tests/multisite/ms-files-rewriting.php8
-rw-r--r--tests/phpunit/tests/multisite/network.php8
-rw-r--r--tests/phpunit/tests/multisite/networkQuery.php8
-rw-r--r--tests/phpunit/tests/multisite/site.php8
-rw-r--r--tests/phpunit/tests/multisite/siteQuery.php8
-rw-r--r--tests/phpunit/tests/multisite/uploadIsUserOverQuota.php8
-rw-r--r--tests/phpunit/tests/multisite/wpMSSitesListTable.php4
-rw-r--r--tests/phpunit/tests/oembed/WpEmbed.php4
-rw-r--r--tests/phpunit/tests/oembed/controller.php8
-rw-r--r--tests/phpunit/tests/oembed/getResponseData.php4
-rw-r--r--tests/phpunit/tests/oembed/wpOembed.php4
-rw-r--r--tests/phpunit/tests/option/multisite.php8
-rw-r--r--tests/phpunit/tests/option/siteTransient.php4
-rw-r--r--tests/phpunit/tests/option/slashes.php4
-rw-r--r--tests/phpunit/tests/option/transient.php4
-rw-r--r--tests/phpunit/tests/option/userSettings.php8
-rw-r--r--tests/phpunit/tests/option/wpLoadAllOptions.php4
-rw-r--r--tests/phpunit/tests/pomo/noopTranslations.php4
-rw-r--r--tests/phpunit/tests/pomo/po.php4
-rw-r--r--tests/phpunit/tests/post.php4
-rw-r--r--tests/phpunit/tests/post/attachments.php4
-rw-r--r--tests/phpunit/tests/post/bodyClass.php4
-rw-r--r--tests/phpunit/tests/post/filtering.php8
-rw-r--r--tests/phpunit/tests/post/getBodyClass.php4
-rw-r--r--tests/phpunit/tests/post/getPageChildren.php4
-rw-r--r--tests/phpunit/tests/post/getPostClass.php4
-rw-r--r--tests/phpunit/tests/post/nav-menu.php4
-rw-r--r--tests/phpunit/tests/post/output.php8
-rw-r--r--tests/phpunit/tests/post/postClass.php4
-rw-r--r--tests/phpunit/tests/post/revisions.php4
-rw-r--r--tests/phpunit/tests/post/slashes.php4
-rw-r--r--tests/phpunit/tests/post/thumbnails.php4
-rw-r--r--tests/phpunit/tests/post/types.php4
-rw-r--r--tests/phpunit/tests/post/walkerPage.php4
-rw-r--r--tests/phpunit/tests/post/wpAfterInsertPost.php8
-rw-r--r--tests/phpunit/tests/post/wpInsertPost.php8
-rw-r--r--tests/phpunit/tests/privacy/wpPrivacyDeleteOldExportFiles.php4
-rw-r--r--tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php8
-rw-r--r--tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php8
-rw-r--r--tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php8
-rw-r--r--tests/phpunit/tests/privacy/wpPrivacySendPersonalDataExportEmail.php8
-rw-r--r--tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php8
-rw-r--r--tests/phpunit/tests/query.php4
-rw-r--r--tests/phpunit/tests/query/commentCount.php8
-rw-r--r--tests/phpunit/tests/query/conditionals.php4
-rw-r--r--tests/phpunit/tests/query/date.php4
-rw-r--r--tests/phpunit/tests/query/dateQuery.php4
-rw-r--r--tests/phpunit/tests/query/invalidQueries.php4
-rw-r--r--tests/phpunit/tests/query/isTerm.php4
-rw-r--r--tests/phpunit/tests/query/postStatus.php4
-rw-r--r--tests/phpunit/tests/query/results.php4
-rw-r--r--tests/phpunit/tests/query/search.php8
-rw-r--r--tests/phpunit/tests/query/verboseRewriteRules.php4
-rw-r--r--tests/phpunit/tests/rest-api.php8
-rw-r--r--tests/phpunit/tests/rest-api/rest-application-passwords-controller.php8
-rw-r--r--tests/phpunit/tests/rest-api/rest-attachments-controller.php8
-rw-r--r--tests/phpunit/tests/rest-api/rest-autosaves-controller.php4
-rw-r--r--tests/phpunit/tests/rest-api/rest-block-renderer-controller.php8
-rw-r--r--tests/phpunit/tests/rest-api/rest-categories-controller.php4
-rw-r--r--tests/phpunit/tests/rest-api/rest-comments-controller.php4
-rw-r--r--tests/phpunit/tests/rest-api/rest-controller.php8
-rw-r--r--tests/phpunit/tests/rest-api/rest-pages-controller.php4
-rw-r--r--tests/phpunit/tests/rest-api/rest-plugins-controller.php4
-rw-r--r--tests/phpunit/tests/rest-api/rest-post-meta-fields.php4
-rw-r--r--tests/phpunit/tests/rest-api/rest-posts-controller.php8
-rw-r--r--tests/phpunit/tests/rest-api/rest-request.php4
-rw-r--r--tests/phpunit/tests/rest-api/rest-revisions-controller.php4
-rw-r--r--tests/phpunit/tests/rest-api/rest-schema-setup.php8
-rw-r--r--tests/phpunit/tests/rest-api/rest-server.php8
-rw-r--r--tests/phpunit/tests/rest-api/rest-settings-controller.php8
-rw-r--r--tests/phpunit/tests/rest-api/rest-sidebars-controller.php4
-rw-r--r--tests/phpunit/tests/rest-api/rest-tags-controller.php4
-rw-r--r--tests/phpunit/tests/rest-api/rest-term-meta-fields.php4
-rw-r--r--tests/phpunit/tests/rest-api/rest-themes-controller.php4
-rw-r--r--tests/phpunit/tests/rest-api/rest-users-controller.php4
-rw-r--r--tests/phpunit/tests/rest-api/rest-widgets-controller.php4
-rw-r--r--tests/phpunit/tests/rewrite.php8
-rw-r--r--tests/phpunit/tests/rewrite/addRewriteEndpoint.php8
-rw-r--r--tests/phpunit/tests/rewrite/addRewriteRule.php4
-rw-r--r--tests/phpunit/tests/rewrite/numericSlugs.php4
-rw-r--r--tests/phpunit/tests/rewrite/oldDateRedirect.php8
-rw-r--r--tests/phpunit/tests/rewrite/oldSlugRedirect.php8
-rw-r--r--tests/phpunit/tests/rewrite/permastructs.php4
-rw-r--r--tests/phpunit/tests/rewrite/rewriteTags.php4
-rw-r--r--tests/phpunit/tests/robots.php4
-rw-r--r--tests/phpunit/tests/shortcode.php8
-rw-r--r--tests/phpunit/tests/taxonomy/getObjectTaxonomies.php4
-rw-r--r--tests/phpunit/tests/taxonomy/isTaxonomyViewable.php4
-rw-r--r--tests/phpunit/tests/template.php8
-rw-r--r--tests/phpunit/tests/term/cache.php4
-rw-r--r--tests/phpunit/tests/term/getEditTermLink.php4
-rw-r--r--tests/phpunit/tests/term/getTerm.php4
-rw-r--r--tests/phpunit/tests/term/getTermField.php4
-rw-r--r--tests/phpunit/tests/term/getTermLink.php4
-rw-r--r--tests/phpunit/tests/term/getTermParentsList.php4
-rw-r--r--tests/phpunit/tests/term/getTerms.php4
-rw-r--r--tests/phpunit/tests/term/meta.php4
-rw-r--r--tests/phpunit/tests/term/slashes.php4
-rw-r--r--tests/phpunit/tests/term/splitSharedTerm.php4
-rw-r--r--tests/phpunit/tests/term/taxQuery.php4
-rw-r--r--tests/phpunit/tests/term/termCounts.php4
-rw-r--r--tests/phpunit/tests/term/wpGetObjectTerms.php4
-rw-r--r--tests/phpunit/tests/term/wpInsertTerm.php4
-rw-r--r--tests/phpunit/tests/term/wpTerm.php4
-rw-r--r--tests/phpunit/tests/term/wpUniqueTermSlug.php4
-rw-r--r--tests/phpunit/tests/theme.php8
-rw-r--r--tests/phpunit/tests/theme/customHeader.php8
-rw-r--r--tests/phpunit/tests/theme/themeDir.php8
-rw-r--r--tests/phpunit/tests/theme/wpTheme.php8
-rw-r--r--tests/phpunit/tests/theme/wpThemeJsonResolver.php8
-rw-r--r--tests/phpunit/tests/upload.php4
-rw-r--r--tests/phpunit/tests/url.php4
-rw-r--r--tests/phpunit/tests/user.php4
-rw-r--r--tests/phpunit/tests/user/author.php4
-rw-r--r--tests/phpunit/tests/user/capabilities.php4
-rw-r--r--tests/phpunit/tests/user/countUserPosts.php4
-rw-r--r--tests/phpunit/tests/user/multisite.php8
-rw-r--r--tests/phpunit/tests/user/session.php4
-rw-r--r--tests/phpunit/tests/user/slashes.php4
-rw-r--r--tests/phpunit/tests/user/wpSendUserRequest.php8
-rw-r--r--tests/phpunit/tests/walker.php4
-rw-r--r--tests/phpunit/tests/widgets.php4
-rw-r--r--tests/phpunit/tests/wp.php4
-rw-r--r--tests/phpunit/tests/xmlrpc/wp/getMediaItem.php8
-rw-r--r--tests/phpunit/tests/xmlrpc/wp/getPost.php4
-rw-r--r--tests/phpunit/tests/xmlrpc/wp/getPostType.php4
-rw-r--r--tests/phpunit/tests/xmlrpc/wp/getUser.php4
-rw-r--r--tests/phpunit/tests/xmlrpc/wp/restoreRevision.php4
-rw-r--r--tests/phpunit/tests/xmlrpc/wp/uploadFile.php4
260 files changed, 726 insertions, 726 deletions
diff --git a/tests/phpunit/includes/abstract-testcase.php b/tests/phpunit/includes/abstract-testcase.php
index 59ea4635fd..d5dccc9d16 100644
--- a/tests/phpunit/includes/abstract-testcase.php
+++ b/tests/phpunit/includes/abstract-testcase.php
@@ -60,7 +60,7 @@ abstract class WP_UnitTestCase_Base extends PHPUnit_Adapter_TestCase {
/**
* Runs the routine before setting up all tests.
*/
- public static function setUpBeforeClass() {
+ public static function set_up_before_class() {
global $wpdb;
$wpdb->suppress_errors = false;
@@ -68,7 +68,7 @@ abstract class WP_UnitTestCase_Base extends PHPUnit_Adapter_TestCase {
$wpdb->db_connect();
ini_set( 'display_errors', 1 );
- parent::setUpBeforeClass();
+ parent::set_up_before_class();
$class = get_called_class();
@@ -82,8 +82,8 @@ abstract class WP_UnitTestCase_Base extends PHPUnit_Adapter_TestCase {
/**
* Runs the routine after all tests have been run.
*/
- public static function tearDownAfterClass() {
- parent::tearDownAfterClass();
+ public static function tear_down_after_class() {
+ parent::tear_down_after_class();
_delete_all_data();
self::flush_cache();
@@ -100,7 +100,7 @@ abstract class WP_UnitTestCase_Base extends PHPUnit_Adapter_TestCase {
/**
* Runs the routine before each test is executed.
*/
- public function setUp() {
+ public function set_up() {
set_time_limit( 0 );
if ( ! self::$ignore_files ) {
@@ -140,7 +140,7 @@ abstract class WP_UnitTestCase_Base extends PHPUnit_Adapter_TestCase {
/**
* After a test method runs, resets any state in WordPress the test method might have changed.
*/
- public function tearDown() {
+ public function tear_down() {
global $wpdb, $wp_query, $wp;
$wpdb->query( 'ROLLBACK' );
if ( is_multisite() ) {
@@ -535,7 +535,7 @@ abstract class WP_UnitTestCase_Base extends PHPUnit_Adapter_TestCase {
*
* @since 4.2.0
*/
- protected function assertPostConditions() {
+ protected function assert_post_conditions() {
$this->expectedDeprecated();
}
diff --git a/tests/phpunit/includes/testcase-ajax.php b/tests/phpunit/includes/testcase-ajax.php
index c6db8305c6..0478c10900 100644
--- a/tests/phpunit/includes/testcase-ajax.php
+++ b/tests/phpunit/includes/testcase-ajax.php
@@ -115,8 +115,8 @@ abstract class WP_Ajax_UnitTestCase extends WP_UnitTestCase {
'wp-privacy-erase-personal-data',
);
- public static function setUpBeforeClass() {
- parent::setUpBeforeClass();
+ public static function set_up_before_class() {
+ parent::set_up_before_class();
remove_action( 'admin_init', '_maybe_update_core' );
remove_action( 'admin_init', '_maybe_update_plugins' );
@@ -135,8 +135,8 @@ abstract class WP_Ajax_UnitTestCase extends WP_UnitTestCase {
*
* Overrides wp_die(), pretends to be Ajax, and suppresses E_WARNINGs.
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
add_filter( 'wp_doing_ajax', '__return_true' );
add_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ), 1, 1 );
@@ -156,7 +156,7 @@ abstract class WP_Ajax_UnitTestCase extends WP_UnitTestCase {
*
* Resets $_POST, removes the wp_die() override, restores error reporting.
*/
- public function tearDown() {
+ public function tear_down() {
$_POST = array();
$_GET = array();
unset( $GLOBALS['post'] );
@@ -165,7 +165,7 @@ abstract class WP_Ajax_UnitTestCase extends WP_UnitTestCase {
remove_action( 'clear_auth_cookie', array( $this, 'logout' ) );
error_reporting( $this->_error_level );
set_current_screen( 'front' );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/includes/testcase-canonical.php b/tests/phpunit/includes/testcase-canonical.php
index 9c27471a0c..ef33ca8db8 100644
--- a/tests/phpunit/includes/testcase-canonical.php
+++ b/tests/phpunit/includes/testcase-canonical.php
@@ -23,8 +23,8 @@ class WP_Canonical_UnitTestCase extends WP_UnitTestCase {
self::delete_shared_fixtures();
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
update_option( 'page_comments', true );
update_option( 'comments_per_page', 5 );
diff --git a/tests/phpunit/includes/testcase-rest-controller.php b/tests/phpunit/includes/testcase-rest-controller.php
index 2c79df11be..a0b96545bf 100644
--- a/tests/phpunit/includes/testcase-rest-controller.php
+++ b/tests/phpunit/includes/testcase-rest-controller.php
@@ -4,8 +4,8 @@ abstract class WP_Test_REST_Controller_Testcase extends WP_Test_REST_TestCase {
protected $server;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
add_filter( 'rest_url', array( $this, 'filter_rest_url_for_leading_slash' ), 10, 2 );
/** @var WP_REST_Server $wp_rest_server */
global $wp_rest_server;
@@ -13,12 +13,12 @@ abstract class WP_Test_REST_Controller_Testcase extends WP_Test_REST_TestCase {
do_action( 'rest_api_init', $wp_rest_server );
}
- public function tearDown() {
+ public function tear_down() {
remove_filter( 'rest_url', array( $this, 'test_rest_url_for_leading_slash' ), 10, 2 );
/** @var WP_REST_Server $wp_rest_server */
global $wp_rest_server;
$wp_rest_server = null;
- parent::tearDown();
+ parent::tear_down();
}
abstract public function test_register_routes();
diff --git a/tests/phpunit/includes/testcase-xmlrpc.php b/tests/phpunit/includes/testcase-xmlrpc.php
index a2341db1c4..7ae8d10e62 100644
--- a/tests/phpunit/includes/testcase-xmlrpc.php
+++ b/tests/phpunit/includes/testcase-xmlrpc.php
@@ -6,20 +6,20 @@ require_once ABSPATH . WPINC . '/class-wp-xmlrpc-server.php';
class WP_XMLRPC_UnitTestCase extends WP_UnitTestCase {
protected $myxmlrpcserver;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
add_filter( 'pre_option_enable_xmlrpc', '__return_true' );
$this->myxmlrpcserver = new wp_xmlrpc_server();
}
- function tearDown() {
+ function tear_down() {
remove_filter( 'pre_option_enable_xmlrpc', '__return_true' );
$this->remove_added_uploads();
- parent::tearDown();
+ parent::tear_down();
}
protected static function make_user_by_role( $role ) {
diff --git a/tests/phpunit/tests/admin/includesCommunityEvents.php b/tests/phpunit/tests/admin/includesCommunityEvents.php
index 6b84790334..4ca5a64360 100644
--- a/tests/phpunit/tests/admin/includesCommunityEvents.php
+++ b/tests/phpunit/tests/admin/includesCommunityEvents.php
@@ -31,8 +31,8 @@ class Test_WP_Community_Events extends WP_UnitTestCase {
*
* @since 4.8.0
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
require_once ABSPATH . 'wp-admin/includes/class-wp-community-events.php';
diff --git a/tests/phpunit/tests/admin/includesListTable.php b/tests/phpunit/tests/admin/includesListTable.php
index a9f5df0205..b15d6d5c15 100644
--- a/tests/phpunit/tests/admin/includesListTable.php
+++ b/tests/phpunit/tests/admin/includesListTable.php
@@ -14,8 +14,8 @@ class Tests_Admin_includesListTable extends WP_UnitTestCase {
*/
protected $table;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->table = _get_list_table( 'WP_Posts_List_Table', array( 'screen' => 'edit-page' ) );
}
diff --git a/tests/phpunit/tests/admin/includesScreen.php b/tests/phpunit/tests/admin/includesScreen.php
index 742bb8b3b7..a93803e57e 100644
--- a/tests/phpunit/tests/admin/includesScreen.php
+++ b/tests/phpunit/tests/admin/includesScreen.php
@@ -155,9 +155,9 @@ class Tests_Admin_includesScreen extends WP_UnitTestCase {
),
);
- function tearDown() {
+ function tear_down() {
unset( $GLOBALS['wp_taxonomies']['old-or-new'] );
- parent::tearDown();
+ parent::tear_down();
}
function test_set_current_screen_with_hook_suffix() {
diff --git a/tests/phpunit/tests/admin/includesTheme.php b/tests/phpunit/tests/admin/includesTheme.php
index ca842df921..58b7ff5391 100644
--- a/tests/phpunit/tests/admin/includesTheme.php
+++ b/tests/phpunit/tests/admin/includesTheme.php
@@ -4,8 +4,8 @@
*/
class Tests_Admin_includesTheme extends WP_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->theme_root = DIR_TESTDATA . '/themedir1';
$this->orig_theme_dir = $GLOBALS['wp_theme_directories'];
@@ -20,7 +20,7 @@ class Tests_Admin_includesTheme extends WP_UnitTestCase {
unset( $GLOBALS['wp_themes'] );
}
- function tearDown() {
+ function tear_down() {
$GLOBALS['wp_theme_directories'] = $this->orig_theme_dir;
remove_filter( 'theme_root', array( $this, '_theme_root' ) );
remove_filter( 'stylesheet_root', array( $this, '_theme_root' ) );
@@ -28,7 +28,7 @@ class Tests_Admin_includesTheme extends WP_UnitTestCase {
wp_clean_themes_cache();
unset( $GLOBALS['wp_themes'] );
- parent::tearDown();
+ parent::tear_down();
}
// Replace the normal theme root directory with our premade test directory.
diff --git a/tests/phpunit/tests/adminbar.php b/tests/phpunit/tests/adminbar.php
index ae24c8201c..539a7a9f76 100644
--- a/tests/phpunit/tests/adminbar.php
+++ b/tests/phpunit/tests/adminbar.php
@@ -14,8 +14,8 @@ class Tests_AdminBar extends WP_UnitTestCase {
protected static $user_ids = array();
- public static function setUpBeforeClass() {
- parent::setUpBeforeClass();
+ public static function set_up_before_class() {
+ parent::set_up_before_class();
require_once ABSPATH . WPINC . '/class-wp-admin-bar.php';
}
diff --git a/tests/phpunit/tests/ajax/CustomizeManager.php b/tests/phpunit/tests/ajax/CustomizeManager.php
index 5dabb44412..cc36aaeff7 100644
--- a/tests/phpunit/tests/ajax/CustomizeManager.php
+++ b/tests/phpunit/tests/ajax/CustomizeManager.php
@@ -50,17 +50,17 @@ class Tests_Ajax_CustomizeManager extends WP_Ajax_UnitTestCase {
/**
* Set up the test fixture.
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
}
/**
* Tear down.
*/
- public function tearDown() {
+ public function tear_down() {
$_REQUEST = array();
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/ajax/CustomizeMenus.php b/tests/phpunit/tests/ajax/CustomizeMenus.php
index 6dbf201089..677ee423a9 100644
--- a/tests/phpunit/tests/ajax/CustomizeMenus.php
+++ b/tests/phpunit/tests/ajax/CustomizeMenus.php
@@ -49,8 +49,8 @@ class Tests_Ajax_CustomizeMenus extends WP_Ajax_UnitTestCase {
/**
* Set up the test fixture.
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
global $wp_customize;
diff --git a/tests/phpunit/tests/ajax/DimComment.php b/tests/phpunit/tests/ajax/DimComment.php
index 89fda6110e..05e6808bfc 100644
--- a/tests/phpunit/tests/ajax/DimComment.php
+++ b/tests/phpunit/tests/ajax/DimComment.php
@@ -25,8 +25,8 @@ class Tests_Ajax_DimComment extends WP_Ajax_UnitTestCase {
/**
* Sets up the test fixture.
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$post_id = self::factory()->post->create();
$this->_comments = self::factory()->comment->create_post_comments( $post_id, 15 );
$this->_comments = array_map( 'get_comment', $this->_comments );
diff --git a/tests/phpunit/tests/ajax/EditComment.php b/tests/phpunit/tests/ajax/EditComment.php
index 83f8fee28b..727372b0e4 100644
--- a/tests/phpunit/tests/ajax/EditComment.php
+++ b/tests/phpunit/tests/ajax/EditComment.php
@@ -25,8 +25,8 @@ class Tests_Ajax_EditComment extends WP_Ajax_UnitTestCase {
/**
* Sets up the test fixture.
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$post_id = self::factory()->post->create();
self::factory()->comment->create_post_comments( $post_id, 5 );
$this->_comment_post = get_post( $post_id );
diff --git a/tests/phpunit/tests/ajax/ManageThemes.php b/tests/phpunit/tests/ajax/ManageThemes.php
index e83a5e7f20..8d0f9c5b7f 100644
--- a/tests/phpunit/tests/ajax/ManageThemes.php
+++ b/tests/phpunit/tests/ajax/ManageThemes.php
@@ -13,8 +13,8 @@ class Tests_Ajax_Manage_Themes extends WP_Ajax_UnitTestCase {
private $orig_theme_dir;
private $theme_root;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->theme_root = DIR_TESTDATA . '/themedir1';
$this->orig_theme_dir = $GLOBALS['wp_theme_directories'];
@@ -30,7 +30,7 @@ class Tests_Ajax_Manage_Themes extends WP_Ajax_UnitTestCase {
unset( $GLOBALS['wp_themes'] );
}
- function tearDown() {
+ function tear_down() {
$GLOBALS['wp_theme_directories'] = $this->orig_theme_dir;
remove_filter( 'theme_root', array( $this, 'filter_theme_root' ) );
remove_filter( 'stylesheet_root', array( $this, 'filter_theme_root' ) );
@@ -38,7 +38,7 @@ class Tests_Ajax_Manage_Themes extends WP_Ajax_UnitTestCase {
wp_clean_themes_cache();
unset( $GLOBALS['wp_themes'] );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/ajax/MediaEdit.php b/tests/phpunit/tests/ajax/MediaEdit.php
index 5bdee5e14b..d42ef09203 100644
--- a/tests/phpunit/tests/ajax/MediaEdit.php
+++ b/tests/phpunit/tests/ajax/MediaEdit.php
@@ -19,10 +19,10 @@ class Tests_Ajax_MediaEdit extends WP_Ajax_UnitTestCase {
/**
* Tear down the test fixture.
*/
- public function tearDown() {
+ public function tear_down() {
// Cleanup.
$this->remove_added_uploads();
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/ajax/PrivacyErasePersonalData.php b/tests/phpunit/tests/ajax/PrivacyErasePersonalData.php
index dc13eea292..194840f163 100644
--- a/tests/phpunit/tests/ajax/PrivacyErasePersonalData.php
+++ b/tests/phpunit/tests/ajax/PrivacyErasePersonalData.php
@@ -126,8 +126,8 @@ class Tests_Ajax_PrivacyErasePersonalData extends WP_Ajax_UnitTestCase {
/**
* Register a custom personal data eraser.
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->key_to_unset = '';
@@ -149,7 +149,7 @@ class Tests_Ajax_PrivacyErasePersonalData extends WP_Ajax_UnitTestCase {
/**
* Clean up after each test method.
*/
- public function tearDown() {
+ public function tear_down() {
remove_filter( 'wp_privacy_personal_data_erasers', array( $this, 'register_custom_personal_data_eraser' ) );
$this->new_callback_value = '';
@@ -157,7 +157,7 @@ class Tests_Ajax_PrivacyErasePersonalData extends WP_Ajax_UnitTestCase {
revoke_super_admin( get_current_user_id() );
}
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/ajax/PrivacyExportPersonalData.php b/tests/phpunit/tests/ajax/PrivacyExportPersonalData.php
index 2c7ed7a62a..4707635a70 100644
--- a/tests/phpunit/tests/ajax/PrivacyExportPersonalData.php
+++ b/tests/phpunit/tests/ajax/PrivacyExportPersonalData.php
@@ -140,8 +140,8 @@ class Tests_Ajax_PrivacyExportPersonalData extends WP_Ajax_UnitTestCase {
*
* @since 5.2.0
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->key_to_unset = '';
$this->new_callback_value = '';
@@ -163,13 +163,13 @@ class Tests_Ajax_PrivacyExportPersonalData extends WP_Ajax_UnitTestCase {
/**
* Clean up after each test method.
*/
- public function tearDown() {
+ public function tear_down() {
remove_filter( 'wp_privacy_personal_data_exporters', array( $this, 'filter_register_custom_personal_data_exporter' ) );
if ( is_multisite() ) {
revoke_super_admin( get_current_user_id() );
}
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/ajax/ReplytoComment.php b/tests/phpunit/tests/ajax/ReplytoComment.php
index f69b3e1fc2..4931a51380 100644
--- a/tests/phpunit/tests/ajax/ReplytoComment.php
+++ b/tests/phpunit/tests/ajax/ReplytoComment.php
@@ -37,9 +37,9 @@ class Tests_Ajax_ReplytoComment extends WP_Ajax_UnitTestCase {
self::$draft_post = $factory->post->create_and_get( array( 'post_status' => 'draft' ) );
}
- public function tearDown() {
+ public function tear_down() {
remove_filter( 'query', array( $this, '_block_comments' ) );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/ajax/Response.php b/tests/phpunit/tests/ajax/Response.php
index 731f09eb5d..986c0971da 100644
--- a/tests/phpunit/tests/ajax/Response.php
+++ b/tests/phpunit/tests/ajax/Response.php
@@ -20,8 +20,8 @@ class Tests_Ajax_Response extends WP_UnitTestCase {
* Set up the test fixture.
* Override wp_die(), pretend to be ajax, and suppres E_WARNINGs
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
add_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ), 1, 1 );
add_filter( 'wp_doing_ajax', '__return_true' );
@@ -35,10 +35,10 @@ class Tests_Ajax_Response extends WP_UnitTestCase {
* Tear down the test fixture.
* Remove the wp_die() override, restore error reporting
*/
- public function tearDown() {
+ public function tear_down() {
remove_filter( 'wp_die_ajax_handler', array( $this, 'getDieHandler' ), 1, 1 );
error_reporting( $this->_error_level );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/attachment/slashes.php b/tests/phpunit/tests/attachment/slashes.php
index d5d5badfa5..70bf9466a8 100644
--- a/tests/phpunit/tests/attachment/slashes.php
+++ b/tests/phpunit/tests/attachment/slashes.php
@@ -12,8 +12,8 @@ class Tests_Attachment_Slashes extends WP_UnitTestCase {
self::$author_id = $factory->user->create( array( 'role' => 'editor' ) );
}
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
wp_set_current_user( self::$author_id );
diff --git a/tests/phpunit/tests/auth.php b/tests/phpunit/tests/auth.php
index 4e665ae8f3..2db8818de7 100644
--- a/tests/phpunit/tests/auth.php
+++ b/tests/phpunit/tests/auth.php
@@ -32,8 +32,8 @@ class Tests_Auth extends WP_UnitTestCase {
self::$wp_hasher = new PasswordHash( 8, true );
}
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->user = clone self::$_user;
wp_set_current_user( self::$user_id );
@@ -42,11 +42,11 @@ class Tests_Auth extends WP_UnitTestCase {
unset( $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'], $GLOBALS['wp_rest_application_password_status'], $GLOBALS['wp_rest_application_password_uuid'] );
}
- public function tearDown() {
+ public function tear_down() {
// Cleanup all the global state.
unset( $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'], $GLOBALS['wp_rest_application_password_status'], $GLOBALS['wp_rest_application_password_uuid'] );
- parent::tearDown();
+ parent::tear_down();
}
function test_auth_cookie_valid() {
diff --git a/tests/phpunit/tests/block-template.php b/tests/phpunit/tests/block-template.php
index c3918eacc2..3830b7fee4 100644
--- a/tests/phpunit/tests/block-template.php
+++ b/tests/phpunit/tests/block-template.php
@@ -35,7 +35,7 @@ class Block_Template_Test extends WP_UnitTestCase {
wp_delete_post( self::$post->ID );
}
- public function tearDown() {
+ public function tear_down() {
global $_wp_current_template_content;
unset( $_wp_current_template_content );
}
diff --git a/tests/phpunit/tests/blocks/context.php b/tests/phpunit/tests/blocks/context.php
index 5131d20b3b..b23b8da3ae 100644
--- a/tests/phpunit/tests/blocks/context.php
+++ b/tests/phpunit/tests/blocks/context.php
@@ -26,10 +26,10 @@ class Tests_Blocks_Context extends WP_UnitTestCase {
/**
* Sets up each test method.
*/
- public function setUp() {
+ public function set_up() {
global $post;
- parent::setUp();
+ parent::set_up();
$args = array(
'post_content' => 'example',
@@ -43,13 +43,13 @@ class Tests_Blocks_Context extends WP_UnitTestCase {
/**
* Tear down each test method.
*/
- public function tearDown() {
+ public function tear_down() {
while ( ! empty( $this->registered_block_names ) ) {
$block_name = array_pop( $this->registered_block_names );
unregister_block_type( $block_name );
}
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/blocks/editor.php b/tests/phpunit/tests/blocks/editor.php
index fac3cec940..a1f43f3010 100644
--- a/tests/phpunit/tests/blocks/editor.php
+++ b/tests/phpunit/tests/blocks/editor.php
@@ -19,10 +19,10 @@ class Tests_Blocks_Editor extends WP_UnitTestCase {
/**
* Sets up each test method.
*/
- public function setUp() {
+ public function set_up() {
global $post;
- parent::setUp();
+ parent::set_up();
$args = array(
'post_title' => 'Example',
@@ -35,11 +35,11 @@ class Tests_Blocks_Editor extends WP_UnitTestCase {
do_action( 'rest_api_init', $wp_rest_server );
}
- public function tearDown() {
+ public function tear_down() {
/** @var WP_REST_Server $wp_rest_server */
global $wp_rest_server;
$wp_rest_server = null;
- parent::tearDown();
+ parent::tear_down();
}
function filter_set_block_categories_post( $block_categories, $post ) {
diff --git a/tests/phpunit/tests/blocks/register.php b/tests/phpunit/tests/blocks/register.php
index 8fc8a90994..8778c95f99 100644
--- a/tests/phpunit/tests/blocks/register.php
+++ b/tests/phpunit/tests/blocks/register.php
@@ -57,7 +57,7 @@ class Tests_Blocks_Register extends WP_UnitTestCase {
*
* @since 5.0.0
*/
- function tearDown() {
+ function tear_down() {
$registry = WP_Block_Type_Registry::get_instance();
foreach ( array( 'core/test-static', 'core/test-dynamic', 'tests/notice' ) as $block_name ) {
@@ -66,7 +66,7 @@ class Tests_Blocks_Register extends WP_UnitTestCase {
}
}
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/blocks/render.php b/tests/phpunit/tests/blocks/render.php
index c8897be977..94f14b390b 100644
--- a/tests/phpunit/tests/blocks/render.php
+++ b/tests/phpunit/tests/blocks/render.php
@@ -37,7 +37,7 @@ class Tests_Blocks_Render extends WP_UnitTestCase {
*
* @since 5.0.0
*/
- public function tearDown() {
+ public function tear_down() {
$this->test_block_instance_number = 0;
$registry = WP_Block_Type_Registry::get_instance();
@@ -48,7 +48,7 @@ class Tests_Blocks_Render extends WP_UnitTestCase {
$registry->unregister( 'core/dynamic' );
}
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/blocks/supportedStyles.php b/tests/phpunit/tests/blocks/supportedStyles.php
index 73b2b1bdc6..b3e50800dd 100644
--- a/tests/phpunit/tests/blocks/supportedStyles.php
+++ b/tests/phpunit/tests/blocks/supportedStyles.php
@@ -39,13 +39,13 @@ class Tests_Blocks_SupportedStyles extends WP_UnitTestCase {
/**
* Tear down each test method.
*/
- public function tearDown() {
+ public function tear_down() {
while ( ! empty( $this->registered_block_names ) ) {
$block_name = array_pop( $this->registered_block_names );
unregister_block_type( $block_name );
}
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/blocks/wpBlock.php b/tests/phpunit/tests/blocks/wpBlock.php
index 84b748540a..a50fc7e878 100644
--- a/tests/phpunit/tests/blocks/wpBlock.php
+++ b/tests/phpunit/tests/blocks/wpBlock.php
@@ -26,8 +26,8 @@ class Tests_Blocks_wpBlock extends WP_UnitTestCase {
/**
* Set up each test method.
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->registry = new WP_Block_Type_Registry();
}
@@ -35,10 +35,10 @@ class Tests_Blocks_wpBlock extends WP_UnitTestCase {
/**
* Tear down each test method.
*/
- public function tearDown() {
+ public function tear_down() {
$this->registry = null;
- parent::tearDown();
+ parent::tear_down();
}
function filter_render_block( $content, $parsed_block ) {
diff --git a/tests/phpunit/tests/blocks/wpBlockList.php b/tests/phpunit/tests/blocks/wpBlockList.php
index 3e1664dacf..084778894e 100644
--- a/tests/phpunit/tests/blocks/wpBlockList.php
+++ b/tests/phpunit/tests/blocks/wpBlockList.php
@@ -26,8 +26,8 @@ class Tests_Blocks_wpBlockList extends WP_UnitTestCase {
/**
* Set up each test method.
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->registry = new WP_Block_Type_Registry();
$this->registry->register( 'core/example', array() );
@@ -36,10 +36,10 @@ class Tests_Blocks_wpBlockList extends WP_UnitTestCase {
/**
* Tear down each test method.
*/
- public function tearDown() {
+ public function tear_down() {
$this->registry = null;
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/blocks/wpBlockTypeRegistry.php b/tests/phpunit/tests/blocks/wpBlockTypeRegistry.php
index 6f2068f966..4d384dc725 100644
--- a/tests/phpunit/tests/blocks/wpBlockTypeRegistry.php
+++ b/tests/phpunit/tests/blocks/wpBlockTypeRegistry.php
@@ -29,8 +29,8 @@ class Tests_Blocks_wpBlockTypeRegistry extends WP_UnitTestCase {
*
* @since 5.0.0
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->registry = new WP_Block_Type_Registry();
}
@@ -40,10 +40,10 @@ class Tests_Blocks_wpBlockTypeRegistry extends WP_UnitTestCase {
*
* @since 5.0.0
*/
- public function tearDown() {
+ public function tear_down() {
$this->registry = null;
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/bookmark/getBookmark.php b/tests/phpunit/tests/bookmark/getBookmark.php
index f9d69dc141..85c55a2684 100644
--- a/tests/phpunit/tests/bookmark/getBookmark.php
+++ b/tests/phpunit/tests/bookmark/getBookmark.php
@@ -33,9 +33,9 @@ class Tests_Bookmark_GetBookmark extends WP_UnitTestCase {
/**
* Reset globals after each test.
*/
- public function tearDown() {
+ public function tear_down() {
unset( $GLOBALS['link'] );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/cache.php b/tests/phpunit/tests/cache.php
index 0874bed8e1..8ca5dd9de2 100644
--- a/tests/phpunit/tests/cache.php
+++ b/tests/phpunit/tests/cache.php
@@ -6,16 +6,16 @@
class Tests_Cache extends WP_UnitTestCase {
public $cache = null;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
// Create two cache objects with a shared cache directory.
// This simulates a typical cache situation, two separate requests interacting.
$this->cache =& $this->init_cache();
}
- function tearDown() {
+ function tear_down() {
$this->flush_cache();
- parent::tearDown();
+ parent::tear_down();
}
function &init_cache() {
diff --git a/tests/phpunit/tests/canonical.php b/tests/phpunit/tests/canonical.php
index bd0b68c038..3069ba8400 100644
--- a/tests/phpunit/tests/canonical.php
+++ b/tests/phpunit/tests/canonical.php
@@ -10,8 +10,8 @@
*/
class Tests_Canonical extends WP_Canonical_UnitTestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
wp_set_current_user( self::$author_id );
}
diff --git a/tests/phpunit/tests/canonical/customRules.php b/tests/phpunit/tests/canonical/customRules.php
index 9a6dc553b1..332701f34b 100644
--- a/tests/phpunit/tests/canonical/customRules.php
+++ b/tests/phpunit/tests/canonical/customRules.php
@@ -7,8 +7,8 @@
*/
class Tests_Canonical_CustomRules extends WP_Canonical_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
global $wp_rewrite;
// Add a custom Rewrite rule to test category redirections.
$wp_rewrite->add_rule( 'ccr/(.+?)/sort/(asc|desc)', 'index.php?category_name=$matches[1]&order=$matches[2]', 'top' ); // ccr = Custom_Cat_Rule.
diff --git a/tests/phpunit/tests/canonical/https.php b/tests/phpunit/tests/canonical/https.php
index 1a903dd74d..4b115e6167 100644
--- a/tests/phpunit/tests/canonical/https.php
+++ b/tests/phpunit/tests/canonical/https.php
@@ -6,8 +6,8 @@
* @group query
*/
class Tests_Canonical_HTTPS extends WP_Canonical_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
create_initial_taxonomies();
diff --git a/tests/phpunit/tests/canonical/noRewrite.php b/tests/phpunit/tests/canonical/noRewrite.php
index 0bdbea2725..abc9bfbca7 100644
--- a/tests/phpunit/tests/canonical/noRewrite.php
+++ b/tests/phpunit/tests/canonical/noRewrite.php
@@ -11,10 +11,10 @@ class Tests_Canonical_NoRewrite extends WP_Canonical_UnitTestCase {
// These test cases are run against the test handler in WP_Canonical.
- public function setUp() {
+ public function set_up() {
global $wp_rewrite;
- parent::setUp();
+ parent::set_up();
$wp_rewrite->init();
$wp_rewrite->set_permalink_structure( '' );
diff --git a/tests/phpunit/tests/canonical/pageOnFront.php b/tests/phpunit/tests/canonical/pageOnFront.php
index 659cbcdaa9..8f6488a9ab 100644
--- a/tests/phpunit/tests/canonical/pageOnFront.php
+++ b/tests/phpunit/tests/canonical/pageOnFront.php
@@ -7,8 +7,8 @@
*/
class Tests_Canonical_PageOnFront extends WP_Canonical_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
update_option( 'show_on_front', 'page' );
update_option(
diff --git a/tests/phpunit/tests/canonical/postStatus.php b/tests/phpunit/tests/canonical/postStatus.php
index 159c3792f0..a4d2071c67 100644
--- a/tests/phpunit/tests/canonical/postStatus.php
+++ b/tests/phpunit/tests/canonical/postStatus.php
@@ -166,8 +166,8 @@ class Tests_Canonical_PostStatus extends WP_Canonical_UnitTestCase {
wp_trash_post( self::$posts['trash-page']->ID );
}
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
self::setup_custom_types();
}
diff --git a/tests/phpunit/tests/canonical/sitemaps.php b/tests/phpunit/tests/canonical/sitemaps.php
index d46028068d..4041ab93f6 100644
--- a/tests/phpunit/tests/canonical/sitemaps.php
+++ b/tests/phpunit/tests/canonical/sitemaps.php
@@ -8,8 +8,8 @@
*/
class Tests_Canonical_Sitemaps extends WP_Canonical_UnitTestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$wp_sitemaps = new WP_Sitemaps();
$wp_sitemaps->init();
}
diff --git a/tests/phpunit/tests/category.php b/tests/phpunit/tests/category.php
index 698e56dc7b..5b88f4117d 100644
--- a/tests/phpunit/tests/category.php
+++ b/tests/phpunit/tests/category.php
@@ -9,9 +9,9 @@
*/
class Tests_Category extends WP_UnitTestCase {
- function tearDown() {
+ function tear_down() {
_unregister_taxonomy( 'test_tax_cat' );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/category/getCategoryParents.php b/tests/phpunit/tests/category/getCategoryParents.php
index d607ca326f..ed218e9f4a 100644
--- a/tests/phpunit/tests/category/getCategoryParents.php
+++ b/tests/phpunit/tests/category/getCategoryParents.php
@@ -7,8 +7,8 @@ class Tests_Category_GetCategoryParents extends WP_UnitTestCase {
protected $c1;
protected $c2;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->c1 = self::factory()->category->create_and_get();
$this->c2 = self::factory()->category->create_and_get(
diff --git a/tests/phpunit/tests/category/walkerCategory.php b/tests/phpunit/tests/category/walkerCategory.php
index aec86e173a..ac49a30216 100644
--- a/tests/phpunit/tests/category/walkerCategory.php
+++ b/tests/phpunit/tests/category/walkerCategory.php
@@ -13,8 +13,8 @@ class Tests_Category_Walker_Category extends WP_UnitTestCase {
/**
* Setup.
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
/** Walker_Category class */
require_once ABSPATH . 'wp-includes/class-walker-category.php';
diff --git a/tests/phpunit/tests/comment-submission.php b/tests/phpunit/tests/comment-submission.php
index 52dcfb43b5..3e6c7ab1c2 100644
--- a/tests/phpunit/tests/comment-submission.php
+++ b/tests/phpunit/tests/comment-submission.php
@@ -34,8 +34,8 @@ class Tests_Comment_Submission extends WP_UnitTestCase {
self::delete_user( self::$editor_id );
}
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
require_once ABSPATH . WPINC . '/class-phpass.php';
}
diff --git a/tests/phpunit/tests/comment.php b/tests/phpunit/tests/comment.php
index ffab40df1e..bccb237d13 100644
--- a/tests/phpunit/tests/comment.php
+++ b/tests/phpunit/tests/comment.php
@@ -8,8 +8,8 @@ class Tests_Comment extends WP_UnitTestCase {
protected static $post_id;
protected static $notify_message = '';
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
reset_phpmailer_instance();
}
diff --git a/tests/phpunit/tests/comment/dateQuery.php b/tests/phpunit/tests/comment/dateQuery.php
index ce295daeff..c59497a835 100644
--- a/tests/phpunit/tests/comment/dateQuery.php
+++ b/tests/phpunit/tests/comment/dateQuery.php
@@ -17,8 +17,8 @@ class Tests_Comment_DateQuery extends WP_UnitTestCase {
public $posts = array();
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
// Just some dummy posts to use as parents for comments.
for ( $i = 1; $i <= 2; $i++ ) {
diff --git a/tests/phpunit/tests/comment/getCommentAuthorEmailLink.php b/tests/phpunit/tests/comment/getCommentAuthorEmailLink.php
index 1e31396d2c..a5ed6aef6b 100644
--- a/tests/phpunit/tests/comment/getCommentAuthorEmailLink.php
+++ b/tests/phpunit/tests/comment/getCommentAuthorEmailLink.php
@@ -5,8 +5,8 @@
class Tests_Comment_GetCommentAuthorEmailLink extends WP_UnitTestCase {
public static $comment;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
// Fake the 'comment' global.
$GLOBALS['comment'] = self::$comment;
@@ -15,9 +15,9 @@ class Tests_Comment_GetCommentAuthorEmailLink extends WP_UnitTestCase {
remove_filter( 'comment_email', 'antispambot' );
}
- public function tearDown() {
+ public function tear_down() {
unset( $GLOBALS['comment'] );
- parent::tearDown();
+ parent::tear_down();
}
public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
diff --git a/tests/phpunit/tests/comment/getCommentsPagesCount.php b/tests/phpunit/tests/comment/getCommentsPagesCount.php
index adf755a329..c843016752 100644
--- a/tests/phpunit/tests/comment/getCommentsPagesCount.php
+++ b/tests/phpunit/tests/comment/getCommentsPagesCount.php
@@ -13,8 +13,8 @@ class Tests_Comment_GetCommentsPagesCount extends WP_UnitTestCase {
/**
* setUp options
*/
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->option_page_comments = get_option( 'page_comments' );
$this->option_page_comments = get_option( 'comments_per_page' );
$this->option_page_comments = get_option( 'thread_comments' );
@@ -26,12 +26,12 @@ class Tests_Comment_GetCommentsPagesCount extends WP_UnitTestCase {
/**
* tearDown options
*/
- function tearDown() {
+ function tear_down() {
update_option( 'page_comments', $this->option_page_comments );
update_option( 'comments_per_page', $this->option_page_comments );
update_option( 'thread_comments', $this->option_page_comments );
update_option( 'posts_per_rss', $this->option_posts_per_rss );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/comment/slashes.php b/tests/phpunit/tests/comment/slashes.php
index d2f7d73ca0..3a386a13ab 100644
--- a/tests/phpunit/tests/comment/slashes.php
+++ b/tests/phpunit/tests/comment/slashes.php
@@ -15,8 +15,8 @@ class Tests_Comment_Slashes extends WP_UnitTestCase {
self::$post_id = $factory->post->create();
}
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
wp_set_current_user( self::$author_id );
diff --git a/tests/phpunit/tests/comment/walker.php b/tests/phpunit/tests/comment/walker.php
index 27fea21b18..32037f52e0 100644
--- a/tests/phpunit/tests/comment/walker.php
+++ b/tests/phpunit/tests/comment/walker.php
@@ -5,8 +5,8 @@
*/
class Tests_Comment_Walker extends WP_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->post_id = self::factory()->post->create();
}
diff --git a/tests/phpunit/tests/cron.php b/tests/phpunit/tests/cron.php
index 6fe4c32bb5..e0f973d51e 100644
--- a/tests/phpunit/tests/cron.php
+++ b/tests/phpunit/tests/cron.php
@@ -16,18 +16,18 @@ class Tests_Cron extends WP_UnitTestCase {
*/
private $plus_thirty_minutes;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
// Make sure the schedule is clear.
_set_cron_array( array() );
$this->preflight_cron_array = array();
$this->plus_thirty_minutes = strtotime( '+30 minutes' );
}
- function tearDown() {
+ function tear_down() {
// Make sure the schedule is clear.
_set_cron_array( array() );
- parent::tearDown();
+ parent::tear_down();
}
function test_wp_get_schedule_empty() {
diff --git a/tests/phpunit/tests/customize/control.php b/tests/phpunit/tests/customize/control.php
index 898fc7711f..df45a4e00a 100644
--- a/tests/phpunit/tests/customize/control.php
+++ b/tests/phpunit/tests/customize/control.php
@@ -24,8 +24,8 @@ class Test_WP_Customize_Control extends WP_UnitTestCase {
/**
* Set up.
*/
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
wp_set_current_user( $this->factory()->user->create( array( 'role' => 'administrator' ) ) );
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
$GLOBALS['wp_customize'] = new WP_Customize_Manager();
@@ -172,9 +172,9 @@ class Test_WP_Customize_Control extends WP_UnitTestCase {
/**
* Tear down.
*/
- function tearDown() {
+ function tear_down() {
$this->wp_customize = null;
unset( $GLOBALS['wp_customize'] );
- parent::tearDown();
+ parent::tear_down();
}
}
diff --git a/tests/phpunit/tests/customize/custom-css-setting.php b/tests/phpunit/tests/customize/custom-css-setting.php
index b82ea00fa2..033d0e9433 100644
--- a/tests/phpunit/tests/customize/custom-css-setting.php
+++ b/tests/phpunit/tests/customize/custom-css-setting.php
@@ -27,8 +27,8 @@ class Test_WP_Customize_Custom_CSS_Setting extends WP_UnitTestCase {
*
* @see WP_UnitTestCase::setup()
*/
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
$user_id = self::factory()->user->create(
@@ -54,9 +54,9 @@ class Test_WP_Customize_Custom_CSS_Setting extends WP_UnitTestCase {
/**
* Tear down the test case.
*/
- function tearDown() {
+ function tear_down() {
$this->setting = null;
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/customize/manager.php b/tests/phpunit/tests/customize/manager.php
index bdf7cb8059..145c04b733 100644
--- a/tests/phpunit/tests/customize/manager.php
+++ b/tests/phpunit/tests/customize/manager.php
@@ -53,8 +53,8 @@ class Tests_WP_Customize_Manager extends WP_UnitTestCase {
/**
* Set up test.
*/
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
$this->manager = $this->instantiate();
$this->undefined = new stdClass();
@@ -70,11 +70,11 @@ class Tests_WP_Customize_Manager extends WP_UnitTestCase {
/**
* Tear down test.
*/
- function tearDown() {
+ function tear_down() {
$this->manager = null;
unset( $GLOBALS['wp_customize'] );
$_REQUEST = array();
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/customize/nav-menu-item-setting.php b/tests/phpunit/tests/customize/nav-menu-item-setting.php
index 68bdd9aba9..f54cf5d5d5 100644
--- a/tests/phpunit/tests/customize/nav-menu-item-setting.php
+++ b/tests/phpunit/tests/customize/nav-menu-item-setting.php
@@ -18,8 +18,8 @@ class Test_WP_Customize_Nav_Menu_Item_Setting extends WP_UnitTestCase {
*
* @see WP_UnitTestCase::setup()
*/
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
diff --git a/tests/phpunit/tests/customize/nav-menu-setting.php b/tests/phpunit/tests/customize/nav-menu-setting.php
index 3a9fd76b21..2f8d0858d6 100644
--- a/tests/phpunit/tests/customize/nav-menu-setting.php
+++ b/tests/phpunit/tests/customize/nav-menu-setting.php
@@ -19,8 +19,8 @@ class Test_WP_Customize_Nav_Menu_Setting extends WP_UnitTestCase {
*
* @see WP_UnitTestCase::setup()
*/
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
diff --git a/tests/phpunit/tests/customize/nav-menus.php b/tests/phpunit/tests/customize/nav-menus.php
index 8c411a316c..1b1ab2c21a 100644
--- a/tests/phpunit/tests/customize/nav-menus.php
+++ b/tests/phpunit/tests/customize/nav-menus.php
@@ -19,8 +19,8 @@ class Test_WP_Customize_Nav_Menus extends WP_UnitTestCase {
*
* @see WP_UnitTestCase::setup()
*/
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
global $wp_customize;
diff --git a/tests/phpunit/tests/customize/panel.php b/tests/phpunit/tests/customize/panel.php
index f3be0961a0..75166327b9 100644
--- a/tests/phpunit/tests/customize/panel.php
+++ b/tests/phpunit/tests/customize/panel.php
@@ -12,18 +12,18 @@ class Tests_WP_Customize_Panel extends WP_UnitTestCase {
*/
protected $manager;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
$GLOBALS['wp_customize'] = new WP_Customize_Manager();
$this->manager = $GLOBALS['wp_customize'];
$this->undefined = new stdClass();
}
- function tearDown() {
+ function tear_down() {
$this->manager = null;
unset( $GLOBALS['wp_customize'] );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/customize/partial.php b/tests/phpunit/tests/customize/partial.php
index e297f0cc73..a47c0ccd1c 100644
--- a/tests/phpunit/tests/customize/partial.php
+++ b/tests/phpunit/tests/customize/partial.php
@@ -29,8 +29,8 @@ class Test_WP_Customize_Partial extends WP_UnitTestCase {
/**
* Set up.
*/
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
$GLOBALS['wp_customize'] = new WP_Customize_Manager();
$this->wp_customize = $GLOBALS['wp_customize'];
@@ -390,9 +390,9 @@ class Test_WP_Customize_Partial extends WP_UnitTestCase {
/**
* Tear down.
*/
- function tearDown() {
+ function tear_down() {
$this->wp_customize = null;
unset( $GLOBALS['wp_customize'] );
- parent::tearDown();
+ parent::tear_down();
}
}
diff --git a/tests/phpunit/tests/customize/section.php b/tests/phpunit/tests/customize/section.php
index 970ef2111c..e846d07535 100644
--- a/tests/phpunit/tests/customize/section.php
+++ b/tests/phpunit/tests/customize/section.php
@@ -19,18 +19,18 @@ class Tests_WP_Customize_Section extends WP_UnitTestCase {
*/
protected $manager;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
$GLOBALS['wp_customize'] = new WP_Customize_Manager();
$this->manager = $GLOBALS['wp_customize'];
$this->undefined = new stdClass();
}
- function tearDown() {
+ function tear_down() {
$this->manager = null;
unset( $GLOBALS['wp_customize'] );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/customize/selective-refresh-ajax.php b/tests/phpunit/tests/customize/selective-refresh-ajax.php
index 156af4338b..035bbd21de 100644
--- a/tests/phpunit/tests/customize/selective-refresh-ajax.php
+++ b/tests/phpunit/tests/customize/selective-refresh-ajax.php
@@ -34,8 +34,8 @@ class Test_WP_Customize_Selective_Refresh_Ajax extends WP_UnitTestCase {
/**
* Set up the test fixture.
*/
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
// Define wp_doing_ajax so that wp_die() will be used instead of die().
add_filter( 'wp_doing_ajax', '__return_true' );
@@ -509,11 +509,11 @@ class Test_WP_Customize_Selective_Refresh_Ajax extends WP_UnitTestCase {
/**
* Tear down.
*/
- function tearDown() {
+ function tear_down() {
$this->expected_partial_ids = null;
$this->wp_customize = null;
unset( $GLOBALS['wp_customize'] );
unset( $GLOBALS['wp_scripts'] );
- parent::tearDown();
+ parent::tear_down();
}
}
diff --git a/tests/phpunit/tests/customize/selective-refresh.php b/tests/phpunit/tests/customize/selective-refresh.php
index adaac5f4b2..c8e649b219 100644
--- a/tests/phpunit/tests/customize/selective-refresh.php
+++ b/tests/phpunit/tests/customize/selective-refresh.php
@@ -29,8 +29,8 @@ class Test_WP_Customize_Selective_Refresh extends WP_UnitTestCase {
/**
* Set up the test fixture.
*/
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
$GLOBALS['wp_customize'] = new WP_Customize_Manager();
$this->wp_customize = $GLOBALS['wp_customize'];
@@ -255,11 +255,11 @@ class Test_WP_Customize_Selective_Refresh extends WP_UnitTestCase {
/**
* Tear down.
*/
- function tearDown() {
+ function tear_down() {
$this->wp_customize = null;
unset( $GLOBALS['wp_customize'] );
unset( $GLOBALS['wp_scripts'] );
- parent::tearDown();
+ parent::tear_down();
}
}
diff --git a/tests/phpunit/tests/customize/setting.php b/tests/phpunit/tests/customize/setting.php
index 46a5897007..b1fe0fd96c 100644
--- a/tests/phpunit/tests/customize/setting.php
+++ b/tests/phpunit/tests/customize/setting.php
@@ -17,18 +17,18 @@ class Tests_WP_Customize_Setting extends WP_UnitTestCase {
*/
public $undefined;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
$GLOBALS['wp_customize'] = new WP_Customize_Manager();
$this->manager = $GLOBALS['wp_customize'];
$this->undefined = new stdClass();
}
- function tearDown() {
+ function tear_down() {
$this->manager = null;
unset( $GLOBALS['wp_customize'] );
- parent::tearDown();
+ parent::tear_down();
}
function test_constructor_without_args() {
diff --git a/tests/phpunit/tests/customize/widgets.php b/tests/phpunit/tests/customize/widgets.php
index 235c45c419..6174999c4f 100644
--- a/tests/phpunit/tests/customize/widgets.php
+++ b/tests/phpunit/tests/customize/widgets.php
@@ -20,8 +20,8 @@ class Tests_WP_Customize_Widgets extends WP_UnitTestCase {
*/
protected $backup_registered_sidebars;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
add_theme_support( 'customize-selective-refresh-widgets' );
@@ -90,12 +90,12 @@ class Tests_WP_Customize_Widgets extends WP_UnitTestCase {
parent::clean_up_global_scope();
}
- function tearDown() {
+ function tear_down() {
$this->manager = null;
unset( $GLOBALS['wp_customize'] );
unset( $GLOBALS['wp_scripts'] );
$GLOBALS['wp_registered_sidebars'] = $this->backup_registered_sidebars;
- parent::tearDown();
+ parent::tear_down();
}
function set_customized_post_data( $customized ) {
diff --git a/tests/phpunit/tests/date/getFeedBuildDate.php b/tests/phpunit/tests/date/getFeedBuildDate.php
index 325fcb423f..de7a1d58a8 100644
--- a/tests/phpunit/tests/date/getFeedBuildDate.php
+++ b/tests/phpunit/tests/date/getFeedBuildDate.php
@@ -8,14 +8,14 @@
*/
class Tests_Date_GetFeedBuildDate extends WP_UnitTestCase {
- function tearDown() {
+ function tear_down() {
global $wp_query;
update_option( 'timezone_string', 'UTC' );
unset( $wp_query );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/date/getPermalink.php b/tests/phpunit/tests/date/getPermalink.php
index 0f7526bea2..f1efdfe66e 100644
--- a/tests/phpunit/tests/date/getPermalink.php
+++ b/tests/phpunit/tests/date/getPermalink.php
@@ -8,13 +8,13 @@
*/
class Tests_Date_GetPermalink extends WP_UnitTestCase {
- function tearDown() {
+ function tear_down() {
delete_option( 'permalink_structure' );
update_option( 'timezone_string', 'UTC' );
// phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set
date_default_timezone_set( 'UTC' );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/date/maybeDeclineDate.php b/tests/phpunit/tests/date/maybeDeclineDate.php
index 0fc80c53e6..857bd41af3 100644
--- a/tests/phpunit/tests/date/maybeDeclineDate.php
+++ b/tests/phpunit/tests/date/maybeDeclineDate.php
@@ -18,22 +18,22 @@ class Tests_Date_MaybeDeclineDate extends WP_UnitTestCase {
*/
private $wp_locale_original;
- public function setUp() {
+ public function set_up() {
global $locale, $wp_locale;
- parent::setUp();
+ parent::set_up();
$this->locale_original = $locale;
$this->wp_locale_original = clone $wp_locale;
}
- public function tearDown() {
+ public function tear_down() {
global $locale, $wp_locale;
$locale = $this->locale_original;
$wp_locale = $this->wp_locale_original;
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/date/mysql2date.php b/tests/phpunit/tests/date/mysql2date.php
index ebed6300de..2591875e63 100644
--- a/tests/phpunit/tests/date/mysql2date.php
+++ b/tests/phpunit/tests/date/mysql2date.php
@@ -7,11 +7,11 @@
*/
class Tests_Date_mysql2date extends WP_UnitTestCase {
- function tearDown() {
+ function tear_down() {
// phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set
date_default_timezone_set( 'UTC' );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/date/query.php b/tests/phpunit/tests/date/query.php
index fd087d6405..e3f4ba0f6f 100644
--- a/tests/phpunit/tests/date/query.php
+++ b/tests/phpunit/tests/date/query.php
@@ -15,8 +15,8 @@ class Tests_Date_Query extends WP_UnitTestCase {
*/
public $q;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
unset( $this->q );
$this->q = new WP_Date_Query( array( 'm' => 2 ) );
}
diff --git a/tests/phpunit/tests/date/wpDate.php b/tests/phpunit/tests/date/wpDate.php
index fa09858d9f..be0ba80135 100644
--- a/tests/phpunit/tests/date/wpDate.php
+++ b/tests/phpunit/tests/date/wpDate.php
@@ -10,20 +10,20 @@ class Tests_Date_wpDate extends WP_UnitTestCase {
/** @var WP_Locale */
private $wp_locale_original;
- public function setUp() {
+ public function set_up() {
global $wp_locale;
- parent::setUp();
+ parent::set_up();
$this->wp_locale_original = clone $wp_locale;
}
- public function tearDown() {
+ public function tear_down() {
global $wp_locale;
$wp_locale = $this->wp_locale_original;
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/db.php b/tests/phpunit/tests/db.php
index c7968cd4d4..2320e30ed5 100644
--- a/tests/phpunit/tests/db.php
+++ b/tests/phpunit/tests/db.php
@@ -21,16 +21,16 @@ class Tests_DB extends WP_UnitTestCase {
*/
protected static $_wpdb;
- public static function setUpBeforeClass() {
- parent::setUpBeforeClass();
+ public static function set_up_before_class() {
+ parent::set_up_before_class();
self::$_wpdb = new WpdbExposedMethodsForTesting();
}
/**
* Set up the test fixture
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->_queries = array();
add_filter( 'query', array( $this, 'query_filter' ) );
}
diff --git a/tests/phpunit/tests/db/charset.php b/tests/phpunit/tests/db/charset.php
index ecb3b10edb..98bf43a925 100644
--- a/tests/phpunit/tests/db/charset.php
+++ b/tests/phpunit/tests/db/charset.php
@@ -22,8 +22,8 @@ class Tests_DB_Charset extends WP_UnitTestCase {
*/
private static $server_info;
- public static function setUpBeforeClass() {
- parent::setUpBeforeClass();
+ public static function set_up_before_class() {
+ parent::set_up_before_class();
require_once dirname( __DIR__ ) . '/db.php';
diff --git a/tests/phpunit/tests/dbdelta.php b/tests/phpunit/tests/dbdelta.php
index adee83e450..543256061e 100644
--- a/tests/phpunit/tests/dbdelta.php
+++ b/tests/phpunit/tests/dbdelta.php
@@ -32,9 +32,9 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* Make sure the upgrade code is loaded before the tests are run.
*/
- public static function setUpBeforeClass() {
+ public static function set_up_before_class() {
- parent::setUpBeforeClass();
+ parent::set_up_before_class();
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
}
@@ -42,7 +42,7 @@ class Tests_dbDelta extends WP_UnitTestCase {
/**
* Create a custom table to be used in each test.
*/
- public function setUp() {
+ public function set_up() {
global $wpdb;
@@ -81,17 +81,17 @@ class Tests_dbDelta extends WP_UnitTestCase {
// This has to be called after the `CREATE TABLE` above as the `_create_temporary_tables` filter
// causes it to create a temporary table, and a temporary table cannot use a FULLTEXT index.
- parent::setUp();
+ parent::set_up();
}
/**
* Delete the custom table on teardown.
*/
- public function tearDown() {
+ public function tear_down() {
global $wpdb;
- parent::tearDown();
+ parent::tear_down();
// This has to be called after the parent `tearDown()` method.
$wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}dbdelta_test" );
diff --git a/tests/phpunit/tests/dependencies/scripts.php b/tests/phpunit/tests/dependencies/scripts.php
index 428e3bfca4..2b385e733d 100644
--- a/tests/phpunit/tests/dependencies/scripts.php
+++ b/tests/phpunit/tests/dependencies/scripts.php
@@ -14,8 +14,8 @@ class Tests_Dependencies_Scripts extends WP_UnitTestCase {
protected $wp_scripts_print_translations_output;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->old_wp_scripts = isset( $GLOBALS['wp_scripts'] ) ? $GLOBALS['wp_scripts'] : null;
remove_action( 'wp_default_scripts', 'wp_default_scripts' );
remove_action( 'wp_default_scripts', 'wp_default_packages' );
@@ -34,10 +34,10 @@ JS;
$this->wp_scripts_print_translations_output .= "\n";
}
- function tearDown() {
+ function tear_down() {
$GLOBALS['wp_scripts'] = $this->old_wp_scripts;
add_action( 'wp_default_scripts', 'wp_default_scripts' );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/dependencies/styles.php b/tests/phpunit/tests/dependencies/styles.php
index 754c15cc85..421959ab7f 100644
--- a/tests/phpunit/tests/dependencies/styles.php
+++ b/tests/phpunit/tests/dependencies/styles.php
@@ -12,8 +12,8 @@ class Tests_Dependencies_Styles extends WP_UnitTestCase {
private $old_wp_styles;
private $old_wp_scripts;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
if ( empty( $GLOBALS['wp_styles'] ) ) {
$GLOBALS['wp_styles'] = null;
@@ -37,7 +37,7 @@ class Tests_Dependencies_Styles extends WP_UnitTestCase {
$GLOBALS['wp_scripts']->default_version = get_bloginfo( 'version' );
}
- function tearDown() {
+ function tear_down() {
$GLOBALS['wp_styles'] = $this->old_wp_styles;
$GLOBALS['wp_scripts'] = $this->old_wp_scripts;
@@ -48,7 +48,7 @@ class Tests_Dependencies_Styles extends WP_UnitTestCase {
remove_theme_support( 'wp-block-styles' );
}
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/feed/atom.php b/tests/phpunit/tests/feed/atom.php
index 6bdf033073..b54c3ae8f4 100644
--- a/tests/phpunit/tests/feed/atom.php
+++ b/tests/phpunit/tests/feed/atom.php
@@ -56,8 +56,8 @@ class Tests_Feeds_Atom extends WP_UnitTestCase {
/**
* Setup.
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->post_count = (int) get_option( 'posts_per_rss' );
$this->excerpt_only = get_option( 'rss_use_excerpt' );
diff --git a/tests/phpunit/tests/feed/rss2.php b/tests/phpunit/tests/feed/rss2.php
index 34aa3b29e0..d2eea6bc62 100644
--- a/tests/phpunit/tests/feed/rss2.php
+++ b/tests/phpunit/tests/feed/rss2.php
@@ -63,8 +63,8 @@ class Tests_Feeds_RSS2 extends WP_UnitTestCase {
/**
* Setup.
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->post_count = (int) get_option( 'posts_per_rss' );
$this->excerpt_only = get_option( 'rss_use_excerpt' );
diff --git a/tests/phpunit/tests/feed/wp-simplepie-file.php b/tests/phpunit/tests/feed/wp-simplepie-file.php
index 860181d397..ada28f6451 100644
--- a/tests/phpunit/tests/feed/wp-simplepie-file.php
+++ b/tests/phpunit/tests/feed/wp-simplepie-file.php
@@ -16,8 +16,8 @@
* @since 5.6.1
*/
class Tests_WP_SimplePie_File extends WP_UnitTestCase {
- public static function setUpBeforeClass() {
- parent::setUpBeforeClass();
+ public static function set_up_before_class() {
+ parent::set_up_before_class();
require_once ABSPATH . '/wp-includes/class-simplepie.php';
require_once ABSPATH . '/wp-includes/class-wp-simplepie-file.php';
diff --git a/tests/phpunit/tests/file.php b/tests/phpunit/tests/file.php
index a127742120..04fd32ff82 100644
--- a/tests/phpunit/tests/file.php
+++ b/tests/phpunit/tests/file.php
@@ -5,8 +5,8 @@
*/
class Tests_File extends WP_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->dir = untrailingslashit( get_temp_dir() );
diff --git a/tests/phpunit/tests/filesystem/base.php b/tests/phpunit/tests/filesystem/base.php
index 54fcb3e1e9..9897b26e78 100644
--- a/tests/phpunit/tests/filesystem/base.php
+++ b/tests/phpunit/tests/filesystem/base.php
@@ -4,20 +4,20 @@
* This class is designed to make use of MockFS, a Virtual in-memory filesystem compatible with WP_Filesystem
*/
abstract class WP_Filesystem_UnitTestCase extends WP_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
add_filter( 'filesystem_method_file', array( $this, 'filter_abstraction_file' ) );
add_filter( 'filesystem_method', array( $this, 'filter_fs_method' ) );
WP_Filesystem();
}
- function tearDown() {
+ function tear_down() {
global $wp_filesystem;
remove_filter( 'filesystem_method_file', array( $this, 'filter_abstraction_file' ) );
remove_filter( 'filesystem_method', array( $this, 'filter_fs_method' ) );
unset( $wp_filesystem );
- parent::tearDown();
+ parent::tear_down();
}
function filter_fs_method( $method ) {
diff --git a/tests/phpunit/tests/formatting/ExcerptRemoveBlocks.php b/tests/phpunit/tests/formatting/ExcerptRemoveBlocks.php
index 9e25158419..ca4b9afef8 100644
--- a/tests/phpunit/tests/formatting/ExcerptRemoveBlocks.php
+++ b/tests/phpunit/tests/formatting/ExcerptRemoveBlocks.php
@@ -59,8 +59,8 @@ class Tests_Formatting_ExcerptRemoveBlocks extends WP_UnitTestCase {
*
* @since 5.2.0
*/
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
self::$post_id = $this->factory()->post->create(
array(
'post_excerpt' => '', // Empty excerpt, so it has to be generated.
@@ -80,11 +80,11 @@ class Tests_Formatting_ExcerptRemoveBlocks extends WP_UnitTestCase {
*
* @since 5.2.0
*/
- function tearDown() {
+ function tear_down() {
$registry = WP_Block_Type_Registry::get_instance();
$registry->unregister( 'core/fake' );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/formatting/redirect.php b/tests/phpunit/tests/formatting/redirect.php
index c3db98976e..6397e468f3 100644
--- a/tests/phpunit/tests/formatting/redirect.php
+++ b/tests/phpunit/tests/formatting/redirect.php
@@ -6,8 +6,8 @@
* @group redirect
*/
class Tests_Formatting_Redirect extends WP_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
add_filter( 'home_url', array( $this, 'home_url' ) );
}
diff --git a/tests/phpunit/tests/functions/deprecated.php b/tests/phpunit/tests/functions/deprecated.php
index 6d8f5f6de0..b1d4a9f6e7 100644
--- a/tests/phpunit/tests/functions/deprecated.php
+++ b/tests/phpunit/tests/functions/deprecated.php
@@ -37,8 +37,8 @@ class Tests_Functions_Deprecated extends WP_UnitTestCase {
/**
* Sets up the test fixture.
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->_deprecated_functions = array();
$this->_deprecated_arguments = array();
$this->_deprecated_files = array();
@@ -53,14 +53,14 @@ class Tests_Functions_Deprecated extends WP_UnitTestCase {
/**
* Tears down the test fixture.
*/
- public function tearDown() {
+ public function tear_down() {
remove_action( 'deprecated_function_run', array( $this, 'deprecated_function' ), 10, 3 );
remove_action( 'deprecated_function_trigger_error', '__return_false' );
remove_action( 'deprecated_argument_run', array( $this, 'deprecated_argument' ), 10, 3 );
remove_action( 'deprecated_argument_trigger_error', '__return_false' );
remove_action( 'deprecated_file_included', array( $this, 'deprecated_argument' ), 10, 4 );
remove_action( 'deprecated_file_trigger_error', '__return_false' );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/functions/doEnclose.php b/tests/phpunit/tests/functions/doEnclose.php
index 768afa4f0f..a271e24f73 100644
--- a/tests/phpunit/tests/functions/doEnclose.php
+++ b/tests/phpunit/tests/functions/doEnclose.php
@@ -23,8 +23,8 @@ class Tests_Functions_DoEnclose extends WP_UnitTestCase {
*
* @since 5.3.0
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
add_filter( 'pre_http_request', array( $this, 'fake_http_request' ), 10, 3 );
}
diff --git a/tests/phpunit/tests/functions/pluginBasename.php b/tests/phpunit/tests/functions/pluginBasename.php
index d7f7bcd6a0..44be82869b 100644
--- a/tests/phpunit/tests/functions/pluginBasename.php
+++ b/tests/phpunit/tests/functions/pluginBasename.php
@@ -21,17 +21,17 @@ class Tests_Functions_PluginBasename extends WP_UnitTestCase {
*/
protected $wp_plugin_path;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->wp_plugin_paths_backup = $GLOBALS['wp_plugin_paths'];
$this->wp_plugin_path = wp_normalize_path( WP_PLUGIN_DIR );
}
- public function tearDown() {
+ public function tear_down() {
$GLOBALS['wp_plugin_paths'] = $this->wp_plugin_paths_backup;
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/functions/referer.php b/tests/phpunit/tests/functions/referer.php
index 220d016139..b1d113afcf 100644
--- a/tests/phpunit/tests/functions/referer.php
+++ b/tests/phpunit/tests/functions/referer.php
@@ -9,20 +9,20 @@
*/
class Tests_Functions_Referer extends WP_UnitTestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$_SERVER['HTTP_REFERER'] = '';
$_SERVER['REQUEST_URI'] = '';
$_REQUEST['_wp_http_referer'] = '';
}
- public function tearDown() {
+ public function tear_down() {
$_SERVER['HTTP_REFERER'] = '';
$_SERVER['REQUEST_URI'] = '';
$_REQUEST['_wp_http_referer'] = '';
- parent::tearDown();
+ parent::tear_down();
}
public function _fake_subfolder_install() {
diff --git a/tests/phpunit/tests/functions/wpGetArchives.php b/tests/phpunit/tests/functions/wpGetArchives.php
index 369a909ca2..1f51d33725 100644
--- a/tests/phpunit/tests/functions/wpGetArchives.php
+++ b/tests/phpunit/tests/functions/wpGetArchives.php
@@ -9,8 +9,8 @@ class Tests_Functions_wpGetArchives extends WP_UnitTestCase {
protected $month_url;
protected $year_url;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->month_url = get_month_link( gmdate( 'Y' ), gmdate( 'm' ) );
$this->year_url = get_year_link( gmdate( 'Y' ) );
diff --git a/tests/phpunit/tests/functions/wpListFilter.php b/tests/phpunit/tests/functions/wpListFilter.php
index d86417cf02..b79837bf16 100644
--- a/tests/phpunit/tests/functions/wpListFilter.php
+++ b/tests/phpunit/tests/functions/wpListFilter.php
@@ -11,8 +11,8 @@ class Tests_Functions_wpListFilter extends WP_UnitTestCase {
public $object_list = array();
public $array_list = array();
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->array_list['foo'] = array(
'name' => 'foo',
'id' => 'f',
diff --git a/tests/phpunit/tests/general/paginateLinks.php b/tests/phpunit/tests/general/paginateLinks.php
index 3d992e3998..df9a43a31f 100644
--- a/tests/phpunit/tests/general/paginateLinks.php
+++ b/tests/phpunit/tests/general/paginateLinks.php
@@ -9,8 +9,8 @@ class Tests_General_PaginateLinks extends WP_UnitTestCase {
private $i18n_count = 0;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->go_to( home_url( '/' ) );
}
diff --git a/tests/phpunit/tests/general/template.php b/tests/phpunit/tests/general/template.php
index 03c543dfa5..d4c14d4ffc 100644
--- a/tests/phpunit/tests/general/template.php
+++ b/tests/phpunit/tests/general/template.php
@@ -17,19 +17,19 @@ class Tests_General_Template extends WP_UnitTestCase {
public $custom_logo_id;
public $custom_logo_url;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->wp_site_icon = new WP_Site_Icon();
}
- function tearDown() {
+ function tear_down() {
global $wp_customize;
$this->_remove_custom_logo();
$this->_remove_site_icon();
$wp_customize = null;
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/general/wpError.php b/tests/phpunit/tests/general/wpError.php
index 1cd8444de2..fee4233d6a 100644
--- a/tests/phpunit/tests/general/wpError.php
+++ b/tests/phpunit/tests/general/wpError.php
@@ -20,8 +20,8 @@ class Tests_General_wpError extends WP_UnitTestCase {
/**
* Set up.
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->wp_error = new WP_Error();
}
diff --git a/tests/phpunit/tests/general/wpGetArchives.php b/tests/phpunit/tests/general/wpGetArchives.php
index 3c7117af93..28fdabaa69 100644
--- a/tests/phpunit/tests/general/wpGetArchives.php
+++ b/tests/phpunit/tests/general/wpGetArchives.php
@@ -6,8 +6,8 @@
* @covers ::wp_get_archives
*/
class Tests_General_wpGetArchives extends WP_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
wp_cache_delete( 'last_changed', 'posts' );
}
diff --git a/tests/phpunit/tests/general/wpGetDocumentTitle.php b/tests/phpunit/tests/general/wpGetDocumentTitle.php
index af78a52a62..07e9ffa43b 100644
--- a/tests/phpunit/tests/general/wpGetDocumentTitle.php
+++ b/tests/phpunit/tests/general/wpGetDocumentTitle.php
@@ -43,8 +43,8 @@ class Tests_General_wpGetDocumentTitle extends WP_UnitTestCase {
);
}
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
add_action( 'after_setup_theme', array( $this, '_add_title_tag_support' ) );
diff --git a/tests/phpunit/tests/general/wpResourceHints.php b/tests/phpunit/tests/general/wpResourceHints.php
index da8d358864..d23ed3dbaf 100644
--- a/tests/phpunit/tests/general/wpResourceHints.php
+++ b/tests/phpunit/tests/general/wpResourceHints.php
@@ -10,8 +10,8 @@ class Tests_General_wpResourceHints extends WP_UnitTestCase {
private $old_wp_scripts;
private $old_wp_styles;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->old_wp_scripts = isset( $GLOBALS['wp_scripts'] ) ? $GLOBALS['wp_scripts'] : null;
$this->old_wp_styles = isset( $GLOBALS['wp_styles'] ) ? $GLOBALS['wp_styles'] : null;
@@ -24,10 +24,10 @@ class Tests_General_wpResourceHints extends WP_UnitTestCase {
$GLOBALS['wp_styles']->default_version = get_bloginfo( 'version' );
}
- function tearDown() {
+ function tear_down() {
$GLOBALS['wp_scripts'] = $this->old_wp_scripts;
$GLOBALS['wp_styles'] = $this->old_wp_styles;
- parent::tearDown();
+ parent::tear_down();
}
function test_should_have_defaults_on_frontend() {
diff --git a/tests/phpunit/tests/hooks/doAction.php b/tests/phpunit/tests/hooks/doAction.php
index b9357ad155..0fb5652f3b 100644
--- a/tests/phpunit/tests/hooks/doAction.php
+++ b/tests/phpunit/tests/hooks/doAction.php
@@ -11,8 +11,8 @@ class Tests_Hooks_DoAction extends WP_UnitTestCase {
private $action_output = '';
private $hook;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->events = array();
}
diff --git a/tests/phpunit/tests/http/base.php b/tests/phpunit/tests/http/base.php
index 14aa731cec..32be98339b 100644
--- a/tests/phpunit/tests/http/base.php
+++ b/tests/phpunit/tests/http/base.php
@@ -17,8 +17,8 @@ abstract class WP_HTTP_UnitTestCase extends WP_UnitTestCase {
protected $http_request_args;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$class = 'WP_Http_' . ucfirst( $this->transport );
if ( ! call_user_func( array( $class, 'test' ) ) ) {
diff --git a/tests/phpunit/tests/http/wpGetHttpHeaders.php b/tests/phpunit/tests/http/wpGetHttpHeaders.php
index 9c6c025f03..4b7b867a49 100644
--- a/tests/phpunit/tests/http/wpGetHttpHeaders.php
+++ b/tests/phpunit/tests/http/wpGetHttpHeaders.php
@@ -9,8 +9,8 @@ class Tests_HTTP_wpGetHttpHeaders extends WP_UnitTestCase {
/**
* Set up the environment
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
// Hook a fake HTTP request response.
add_filter( 'pre_http_request', array( $this, 'fake_http_request' ), 10, 3 );
diff --git a/tests/phpunit/tests/https-detection.php b/tests/phpunit/tests/https-detection.php
index acc123ee6d..6ed466af6a 100644
--- a/tests/phpunit/tests/https-detection.php
+++ b/tests/phpunit/tests/https-detection.php
@@ -7,8 +7,8 @@ class Tests_HTTPS_Detection extends WP_UnitTestCase {
private $last_request_url;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
remove_all_filters( 'option_home' );
remove_all_filters( 'option_siteurl' );
diff --git a/tests/phpunit/tests/image/base.php b/tests/phpunit/tests/image/base.php
index deaeaad33e..52c012d073 100644
--- a/tests/phpunit/tests/image/base.php
+++ b/tests/phpunit/tests/image/base.php
@@ -8,8 +8,8 @@ abstract class WP_Image_UnitTestCase extends WP_UnitTestCase {
/**
* Set the image editor engine according to the unit test's specification
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
if ( ! call_user_func( array( $this->editor_engine, 'test' ) ) ) {
$this->markTestSkipped( sprintf( 'The image editor engine %s is not supported on this system.', $this->editor_engine ) );
diff --git a/tests/phpunit/tests/image/editor.php b/tests/phpunit/tests/image/editor.php
index ab6fe9f666..7ed30ebdb0 100644
--- a/tests/phpunit/tests/image/editor.php
+++ b/tests/phpunit/tests/image/editor.php
@@ -14,13 +14,13 @@ class Tests_Image_Editor extends WP_Image_UnitTestCase {
/**
* Setup test fixture
*/
- public function setUp() {
+ public function set_up() {
require_once ABSPATH . WPINC . '/class-wp-image-editor.php';
require_once DIR_TESTDATA . '/../includes/mock-image-editor.php';
// This needs to come after the mock image editor class is loaded.
- parent::setUp();
+ parent::set_up();
}
/**
diff --git a/tests/phpunit/tests/image/editorGd.php b/tests/phpunit/tests/image/editorGd.php
index ed26316503..781ff96cb4 100644
--- a/tests/phpunit/tests/image/editorGd.php
+++ b/tests/phpunit/tests/image/editorGd.php
@@ -13,15 +13,15 @@ class Tests_Image_Editor_GD extends WP_Image_UnitTestCase {
public $editor_engine = 'WP_Image_Editor_GD';
- public function setUp() {
+ public function set_up() {
require_once ABSPATH . WPINC . '/class-wp-image-editor.php';
require_once ABSPATH . WPINC . '/class-wp-image-editor-gd.php';
// This needs to come after the mock image editor class is loaded.
- parent::setUp();
+ parent::set_up();
}
- public function tearDown() {
+ public function tear_down() {
$folder = DIR_TESTDATA . '/images/waffles-*.jpg';
foreach ( glob( $folder ) as $file ) {
@@ -30,7 +30,7 @@ class Tests_Image_Editor_GD extends WP_Image_UnitTestCase {
$this->remove_added_uploads();
- parent::tearDown();
+ parent::tear_down();
}
public function test_supports_mime_type_jpeg() {
diff --git a/tests/phpunit/tests/image/editorImagick.php b/tests/phpunit/tests/image/editorImagick.php
index 32f651fd29..e82486d828 100644
--- a/tests/phpunit/tests/image/editorImagick.php
+++ b/tests/phpunit/tests/image/editorImagick.php
@@ -13,16 +13,16 @@ class Tests_Image_Editor_Imagick extends WP_Image_UnitTestCase {
public $editor_engine = 'WP_Image_Editor_Imagick';
- public function setUp() {
+ public function set_up() {
require_once ABSPATH . WPINC . '/class-wp-image-editor.php';
require_once ABSPATH . WPINC . '/class-wp-image-editor-imagick.php';
require_once DIR_TESTROOT . '/includes/class-wp-test-stream.php';
// This needs to come after the mock image editor class is loaded.
- parent::setUp();
+ parent::set_up();
}
- public function tearDown() {
+ public function tear_down() {
$folder = DIR_TESTDATA . '/images/waffles-*.jpg';
foreach ( glob( $folder ) as $file ) {
@@ -31,7 +31,7 @@ class Tests_Image_Editor_Imagick extends WP_Image_UnitTestCase {
$this->remove_added_uploads();
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/image/functions.php b/tests/phpunit/tests/image/functions.php
index 204a79a648..b90c9f25f7 100644
--- a/tests/phpunit/tests/image/functions.php
+++ b/tests/phpunit/tests/image/functions.php
@@ -10,8 +10,8 @@ class Tests_Image_Functions extends WP_UnitTestCase {
/**
* Setup test fixture
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
require_once ABSPATH . WPINC . '/class-wp-image-editor.php';
require_once ABSPATH . WPINC . '/class-wp-image-editor-gd.php';
diff --git a/tests/phpunit/tests/image/header.php b/tests/phpunit/tests/image/header.php
index 99848bba0a..87dd50bce6 100644
--- a/tests/phpunit/tests/image/header.php
+++ b/tests/phpunit/tests/image/header.php
@@ -8,8 +8,8 @@ require_once ABSPATH . 'wp-admin/includes/class-custom-image-header.php';
class Tests_Image_Header extends WP_UnitTestCase {
public $custom_image_header;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->custom_image_header = new Custom_Image_Header( '__return_null' );
}
diff --git a/tests/phpunit/tests/image/intermediateSize.php b/tests/phpunit/tests/image/intermediateSize.php
index d157d45c00..d2098c49e1 100644
--- a/tests/phpunit/tests/image/intermediateSize.php
+++ b/tests/phpunit/tests/image/intermediateSize.php
@@ -5,14 +5,14 @@
* @group upload
*/
class Tests_Image_Intermediate_Size extends WP_UnitTestCase {
- function tearDown() {
+ function tear_down() {
$this->remove_added_uploads();
remove_image_size( 'test-size' );
remove_image_size( 'false-height' );
remove_image_size( 'false-width' );
remove_image_size( 'off-by-one' );
- parent::tearDown();
+ parent::tear_down();
}
public function _make_attachment( $file, $parent_post_id = 0 ) {
diff --git a/tests/phpunit/tests/image/resize.php b/tests/phpunit/tests/image/resize.php
index afe7aa05c0..1261600875 100644
--- a/tests/phpunit/tests/image/resize.php
+++ b/tests/phpunit/tests/image/resize.php
@@ -10,8 +10,8 @@ require_once __DIR__ . '/base.php';
abstract class WP_Tests_Image_Resize_UnitTestCase extends WP_Image_UnitTestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
add_filter( 'wp_image_editors', array( $this, 'wp_image_editors' ) );
}
diff --git a/tests/phpunit/tests/image/resizeGd.php b/tests/phpunit/tests/image/resizeGd.php
index 171bc3f30a..40a3faebfc 100644
--- a/tests/phpunit/tests/image/resizeGd.php
+++ b/tests/phpunit/tests/image/resizeGd.php
@@ -19,12 +19,12 @@ class Test_Image_Resize_GD extends WP_Tests_Image_Resize_UnitTestCase {
*/
public $editor_engine = 'WP_Image_Editor_GD';
- public function setUp() {
+ public function set_up() {
require_once ABSPATH . WPINC . '/class-wp-image-editor.php';
require_once ABSPATH . WPINC . '/class-wp-image-editor-gd.php';
// This needs to come after the mock image editor class is loaded.
- parent::setUp();
+ parent::set_up();
}
/**
diff --git a/tests/phpunit/tests/image/resizeImagick.php b/tests/phpunit/tests/image/resizeImagick.php
index 8a73572f42..4243ea18e4 100644
--- a/tests/phpunit/tests/image/resizeImagick.php
+++ b/tests/phpunit/tests/image/resizeImagick.php
@@ -17,11 +17,11 @@ class Test_Image_Resize_Imagick extends WP_Tests_Image_Resize_UnitTestCase {
*/
public $editor_engine = 'WP_Image_Editor_Imagick';
- public function setUp() {
+ public function set_up() {
require_once ABSPATH . WPINC . '/class-wp-image-editor.php';
require_once ABSPATH . WPINC . '/class-wp-image-editor-imagick.php';
// This needs to come after the mock image editor class is loaded.
- parent::setUp();
+ parent::set_up();
}
}
diff --git a/tests/phpunit/tests/image/siteIcon.php b/tests/phpunit/tests/image/siteIcon.php
index 8e65a7bdc0..1123b06bb3 100644
--- a/tests/phpunit/tests/image/siteIcon.php
+++ b/tests/phpunit/tests/image/siteIcon.php
@@ -12,16 +12,16 @@ class Tests_WP_Site_Icon extends WP_UnitTestCase {
public $attachment_id = 0;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->wp_site_icon = new WP_Site_Icon();
}
- function tearDown() {
+ function tear_down() {
$this->_remove_custom_logo();
$this->remove_added_uploads();
- parent::tearDown();
+ parent::tear_down();
}
function _remove_custom_logo() {
diff --git a/tests/phpunit/tests/import/import.php b/tests/phpunit/tests/import/import.php
index b3e2214f68..a5ebcfe137 100644
--- a/tests/phpunit/tests/import/import.php
+++ b/tests/phpunit/tests/import/import.php
@@ -6,8 +6,8 @@ require_once __DIR__ . '/base.php';
* @group import
*/
class Tests_Import_Import extends WP_Import_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
if ( ! defined( 'WP_IMPORTING' ) ) {
define( 'WP_IMPORTING', true );
diff --git a/tests/phpunit/tests/import/parser.php b/tests/phpunit/tests/import/parser.php
index 8142ef6a18..72f76fb2d2 100644
--- a/tests/phpunit/tests/import/parser.php
+++ b/tests/phpunit/tests/import/parser.php
@@ -6,8 +6,8 @@ require_once __DIR__ . '/base.php';
* @group import
*/
class Tests_Import_Parser extends WP_Import_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
if ( ! defined( 'WP_IMPORTING' ) ) {
define( 'WP_IMPORTING', true );
diff --git a/tests/phpunit/tests/import/postmeta.php b/tests/phpunit/tests/import/postmeta.php
index 54a05743de..f50d96f511 100644
--- a/tests/phpunit/tests/import/postmeta.php
+++ b/tests/phpunit/tests/import/postmeta.php
@@ -6,8 +6,8 @@ require_once __DIR__ . '/base.php';
* @group import
*/
class Tests_Import_Postmeta extends WP_Import_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
if ( ! defined( 'WP_IMPORTING' ) ) {
define( 'WP_IMPORTING', true );
diff --git a/tests/phpunit/tests/includes/factory.php b/tests/phpunit/tests/includes/factory.php
index 47d0968f2b..62e9aedd86 100644
--- a/tests/phpunit/tests/includes/factory.php
+++ b/tests/phpunit/tests/includes/factory.php
@@ -1,8 +1,8 @@
<?php
class TestFactoryFor extends WP_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->category_factory = new WP_UnitTest_Factory_For_Term( null, 'category' );
}
diff --git a/tests/phpunit/tests/l10n/getUserLocale.php b/tests/phpunit/tests/l10n/getUserLocale.php
index c0079321d9..aeefb72c78 100644
--- a/tests/phpunit/tests/l10n/getUserLocale.php
+++ b/tests/phpunit/tests/l10n/getUserLocale.php
@@ -7,8 +7,8 @@
class Tests_L10n_GetUserLocale extends WP_UnitTestCase {
protected $user_id;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->user_id = $this->factory()->user->create(
array(
diff --git a/tests/phpunit/tests/l10n/loadTextdomain.php b/tests/phpunit/tests/l10n/loadTextdomain.php
index ef62106d0a..1381e211bd 100644
--- a/tests/phpunit/tests/l10n/loadTextdomain.php
+++ b/tests/phpunit/tests/l10n/loadTextdomain.php
@@ -17,8 +17,8 @@ class Tests_L10n_LoadTextdomain extends WP_UnitTestCase {
);
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->locale = '';
diff --git a/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php b/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php
index 3619e8110c..0f0ecf5272 100644
--- a/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php
+++ b/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php
@@ -19,8 +19,8 @@ class Tests_L10n_LoadTextdomainJustInTime extends WP_UnitTestCase {
);
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->theme_root = DIR_TESTDATA . '/themedir1';
$this->orig_theme_dir = $GLOBALS['wp_theme_directories'];
@@ -38,7 +38,7 @@ class Tests_L10n_LoadTextdomainJustInTime extends WP_UnitTestCase {
_get_path_to_translation( null, true );
}
- public function tearDown() {
+ public function tear_down() {
$GLOBALS['wp_theme_directories'] = $this->orig_theme_dir;
wp_clean_themes_cache();
unset( $GLOBALS['wp_themes'] );
@@ -46,7 +46,7 @@ class Tests_L10n_LoadTextdomainJustInTime extends WP_UnitTestCase {
unset( $GLOBALS['l10n_unloaded'] );
_get_path_to_translation( null, true );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/l10n/wpLocaleSwitcher.php b/tests/phpunit/tests/l10n/wpLocaleSwitcher.php
index 726863eeee..3b3661790f 100644
--- a/tests/phpunit/tests/l10n/wpLocaleSwitcher.php
+++ b/tests/phpunit/tests/l10n/wpLocaleSwitcher.php
@@ -16,8 +16,8 @@ class Tests_L10n_wpLocaleSwitcher extends WP_UnitTestCase {
*/
protected $previous_locale = '';
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->locale = '';
$this->previous_locale = '';
@@ -27,12 +27,12 @@ class Tests_L10n_wpLocaleSwitcher extends WP_UnitTestCase {
_get_path_to_translation( null, true );
}
- public function tearDown() {
+ public function tear_down() {
unset( $GLOBALS['l10n'] );
unset( $GLOBALS['l10n_unloaded'] );
_get_path_to_translation( null, true );
- parent::tearDown();
+ parent::tear_down();
}
public function test_switch_to_non_existent_locale_returns_false() {
diff --git a/tests/phpunit/tests/link/getAdjacentPostLink.php b/tests/phpunit/tests/link/getAdjacentPostLink.php
index 55ea5445ef..796302bb91 100644
--- a/tests/phpunit/tests/link/getAdjacentPostLink.php
+++ b/tests/phpunit/tests/link/getAdjacentPostLink.php
@@ -11,8 +11,8 @@ class Tests_Link_GetAdjacentPostLink extends WP_UnitTestCase {
protected $post_ids;
protected $cat_id;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->cat_id = self::factory()->category->create( array( 'name' => 'other' ) );
$this->post_ids = array();
$this->post_ids[] = self::factory()->post->create(
diff --git a/tests/phpunit/tests/locale.php b/tests/phpunit/tests/locale.php
index 47d657a942..a89a3034b6 100644
--- a/tests/phpunit/tests/locale.php
+++ b/tests/phpunit/tests/locale.php
@@ -10,8 +10,8 @@ class Tests_Locale extends WP_UnitTestCase {
*/
protected $locale;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->locale = new WP_Locale();
}
diff --git a/tests/phpunit/tests/mail.php b/tests/phpunit/tests/mail.php
index c81ca448be..54fe8794e3 100644
--- a/tests/phpunit/tests/mail.php
+++ b/tests/phpunit/tests/mail.php
@@ -4,14 +4,14 @@
* @group mail
*/
class Tests_Mail extends WP_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
reset_phpmailer_instance();
}
- function tearDown() {
+ function tear_down() {
reset_phpmailer_instance();
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/media.php b/tests/phpunit/tests/media.php
index 1bc558c208..2d2cfa1228 100644
--- a/tests/phpunit/tests/media.php
+++ b/tests/phpunit/tests/media.php
@@ -51,13 +51,13 @@ class Tests_Media extends WP_UnitTestCase {
$GLOBALS['_wp_additional_image_sizes'] = self::$_sizes;
}
- public static function tearDownAfterClass() {
+ public static function tear_down_after_class() {
wp_delete_post( self::$large_id, true );
- parent::tearDownAfterClass();
+ parent::tear_down_after_class();
}
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->caption = 'A simple caption.';
$this->alternate_caption = 'Alternate caption.';
$this->html_content = <<<CAP
diff --git a/tests/phpunit/tests/menu/nav-menu.php b/tests/phpunit/tests/menu/nav-menu.php
index 58a597c858..e03f250a59 100644
--- a/tests/phpunit/tests/menu/nav-menu.php
+++ b/tests/phpunit/tests/menu/nav-menu.php
@@ -8,8 +8,8 @@ class Tests_Nav_Menu_Theme_Change extends WP_UnitTestCase {
/**
* Set up.
*/
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
// Unregister all nav menu locations.
foreach ( array_keys( get_registered_nav_menus() ) as $location ) {
diff --git a/tests/phpunit/tests/menu/walker-nav-menu-edit.php b/tests/phpunit/tests/menu/walker-nav-menu-edit.php
index 5b6d594885..b2ca6a5948 100644
--- a/tests/phpunit/tests/menu/walker-nav-menu-edit.php
+++ b/tests/phpunit/tests/menu/walker-nav-menu-edit.php
@@ -7,10 +7,10 @@
class Tests_Menu_Walker_Nav_Menu_Edit extends WP_UnitTestCase {
protected $_wp_nav_menu_max_depth;
- function setUp() {
+ function set_up() {
global $_wp_nav_menu_max_depth;
- parent::setUp();
+ parent::set_up();
/** Walker_Nav_Menu_Edit class */
require_once ABSPATH . 'wp-admin/includes/class-walker-nav-menu-edit.php';
@@ -20,12 +20,12 @@ class Tests_Menu_Walker_Nav_Menu_Edit extends WP_UnitTestCase {
$this->_wp_nav_menu_max_depth = $_wp_nav_menu_max_depth;
}
- function tearDown() {
+ function tear_down() {
global $_wp_nav_menu_max_depth;
$_wp_nav_menu_max_depth = $this->_wp_nav_menu_max_depth;
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/menu/walker-nav-menu.php b/tests/phpunit/tests/menu/walker-nav-menu.php
index 1352b1d2ff..83523644e5 100644
--- a/tests/phpunit/tests/menu/walker-nav-menu.php
+++ b/tests/phpunit/tests/menu/walker-nav-menu.php
@@ -13,10 +13,10 @@ class Tests_Menu_Walker_Nav_Menu extends WP_UnitTestCase {
/**
* Setup.
*/
- public function setUp() {
+ public function set_up() {
global $_wp_nav_menu_max_depth;
- parent::setUp();
+ parent::set_up();
/** Walker_Nav_Menu class */
require_once ABSPATH . 'wp-includes/class-walker-nav-menu.php';
@@ -28,11 +28,11 @@ class Tests_Menu_Walker_Nav_Menu extends WP_UnitTestCase {
/**
* Tear down
*/
- public function tearDown() {
+ public function tear_down() {
global $_wp_nav_menu_max_depth;
$_wp_nav_menu_max_depth = $this->_wp_nav_menu_max_depth;
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/meta.php b/tests/phpunit/tests/meta.php
index cb819b7d5f..18cec769bd 100644
--- a/tests/phpunit/tests/meta.php
+++ b/tests/phpunit/tests/meta.php
@@ -6,8 +6,8 @@
class Tests_Meta extends WP_UnitTestCase {
protected $updated_mids = array();
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->author = new WP_User( self::factory()->user->create( array( 'role' => 'author' ) ) );
$this->meta_id = add_metadata( 'user', $this->author->ID, 'meta_key', 'meta_value' );
$this->delete_meta_id = add_metadata( 'user', $this->author->ID, 'delete_meta_key', 'delete_meta_value' );
diff --git a/tests/phpunit/tests/meta/slashes.php b/tests/phpunit/tests/meta/slashes.php
index 54393ebfa7..139f4f48dc 100644
--- a/tests/phpunit/tests/meta/slashes.php
+++ b/tests/phpunit/tests/meta/slashes.php
@@ -18,8 +18,8 @@ class Tests_Meta_Slashes extends WP_UnitTestCase {
self::$user_id = $factory->user->create();
}
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
wp_set_current_user( self::$editor_id );
diff --git a/tests/phpunit/tests/multisite.php b/tests/phpunit/tests/multisite.php
index 085d155819..deb45b4fe4 100644
--- a/tests/phpunit/tests/multisite.php
+++ b/tests/phpunit/tests/multisite.php
@@ -10,16 +10,16 @@ if ( is_multisite() ) :
class Tests_Multisite extends WP_UnitTestCase {
protected $suppress = false;
- function setUp() {
+ function set_up() {
global $wpdb;
- parent::setUp();
+ parent::set_up();
$this->suppress = $wpdb->suppress_errors();
}
- function tearDown() {
+ function tear_down() {
global $wpdb;
$wpdb->suppress_errors( $this->suppress );
- parent::tearDown();
+ parent::tear_down();
}
function test_wpmu_log_new_registrations() {
diff --git a/tests/phpunit/tests/multisite/cleanDirsizeCache.php b/tests/phpunit/tests/multisite/cleanDirsizeCache.php
index 2ca6b1fca1..8aaa596d39 100644
--- a/tests/phpunit/tests/multisite/cleanDirsizeCache.php
+++ b/tests/phpunit/tests/multisite/cleanDirsizeCache.php
@@ -11,16 +11,16 @@ if ( is_multisite() ) :
class Tests_Multisite_Dirsize_Cache extends WP_UnitTestCase {
protected $suppress = false;
- function setUp() {
+ function set_up() {
global $wpdb;
- parent::setUp();
+ parent::set_up();
$this->suppress = $wpdb->suppress_errors();
}
- function tearDown() {
+ function tear_down() {
global $wpdb;
$wpdb->suppress_errors( $this->suppress );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/multisite/getSpaceAllowed.php b/tests/phpunit/tests/multisite/getSpaceAllowed.php
index a1c6678d76..735e4320c2 100644
--- a/tests/phpunit/tests/multisite/getSpaceAllowed.php
+++ b/tests/phpunit/tests/multisite/getSpaceAllowed.php
@@ -10,17 +10,17 @@ if ( is_multisite() ) :
class Tests_Multisite_Get_Space_Allowed extends WP_UnitTestCase {
protected $suppress = false;
- public function setUp() {
+ public function set_up() {
global $wpdb;
- parent::setUp();
+ parent::set_up();
$this->suppress = $wpdb->suppress_errors();
}
- public function tearDown() {
+ public function tear_down() {
global $wpdb;
$wpdb->suppress_errors( $this->suppress );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/multisite/getSpaceUsed.php b/tests/phpunit/tests/multisite/getSpaceUsed.php
index f3a4c93ecc..b6492d661e 100644
--- a/tests/phpunit/tests/multisite/getSpaceUsed.php
+++ b/tests/phpunit/tests/multisite/getSpaceUsed.php
@@ -9,16 +9,16 @@ if ( is_multisite() ) :
class Tests_Multisite_Get_Space_Used extends WP_UnitTestCase {
protected $suppress = false;
- function setUp() {
+ function set_up() {
global $wpdb;
- parent::setUp();
+ parent::set_up();
$this->suppress = $wpdb->suppress_errors();
}
- function tearDown() {
+ function tear_down() {
global $wpdb;
$wpdb->suppress_errors( $this->suppress );
- parent::tearDown();
+ parent::tear_down();
}
function test_get_space_used_switched_site() {
diff --git a/tests/phpunit/tests/multisite/isUploadSpaceAvailable.php b/tests/phpunit/tests/multisite/isUploadSpaceAvailable.php
index 5abe85f9d4..d520791879 100644
--- a/tests/phpunit/tests/multisite/isUploadSpaceAvailable.php
+++ b/tests/phpunit/tests/multisite/isUploadSpaceAvailable.php
@@ -13,19 +13,19 @@ if ( is_multisite() ) :
class Tests_Multisite_Is_Upload_Space_Available extends WP_UnitTestCase {
protected $suppress = false;
- public function setUp() {
+ public function set_up() {
global $wpdb;
- parent::setUp();
+ parent::set_up();
$this->suppress = $wpdb->suppress_errors();
update_site_option( 'upload_space_check_disabled', false );
}
- public function tearDown() {
+ public function tear_down() {
global $wpdb;
$wpdb->suppress_errors( $this->suppress );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/multisite/ms-files-rewriting.php b/tests/phpunit/tests/multisite/ms-files-rewriting.php
index 89cd341fb2..a11ebe0b45 100644
--- a/tests/phpunit/tests/multisite/ms-files-rewriting.php
+++ b/tests/phpunit/tests/multisite/ms-files-rewriting.php
@@ -14,21 +14,21 @@ if ( is_multisite() ) :
class Tests_Multisite_MS_Files_Rewriting extends WP_UnitTestCase {
protected $suppress = false;
- function setUp() {
+ function set_up() {
global $wpdb;
- parent::setUp();
+ parent::set_up();
$this->suppress = $wpdb->suppress_errors();
update_site_option( 'ms_files_rewriting', 1 );
ms_upload_constants();
}
- function tearDown() {
+ function tear_down() {
global $wpdb;
$wpdb->suppress_errors( $this->suppress );
- parent::tearDown();
+ parent::tear_down();
}
function test_switch_upload_dir() {
diff --git a/tests/phpunit/tests/multisite/network.php b/tests/phpunit/tests/multisite/network.php
index 8a8e5537ee..656db4fbb1 100644
--- a/tests/phpunit/tests/multisite/network.php
+++ b/tests/phpunit/tests/multisite/network.php
@@ -15,17 +15,17 @@ if ( is_multisite() ) :
protected static $different_network_id;
protected static $different_site_ids = array();
- function setUp() {
+ function set_up() {
global $wpdb;
- parent::setUp();
+ parent::set_up();
$this->suppress = $wpdb->suppress_errors();
}
- function tearDown() {
+ function tear_down() {
global $wpdb, $current_site;
$wpdb->suppress_errors( $this->suppress );
$current_site->id = 1;
- parent::tearDown();
+ parent::tear_down();
}
public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
diff --git a/tests/phpunit/tests/multisite/networkQuery.php b/tests/phpunit/tests/multisite/networkQuery.php
index c8cc34d667..a69bc2210c 100644
--- a/tests/phpunit/tests/multisite/networkQuery.php
+++ b/tests/phpunit/tests/multisite/networkQuery.php
@@ -14,16 +14,16 @@ if ( is_multisite() ) :
protected $suppress = false;
- function setUp() {
+ function set_up() {
global $wpdb;
- parent::setUp();
+ parent::set_up();
$this->suppress = $wpdb->suppress_errors();
}
- function tearDown() {
+ function tear_down() {
global $wpdb;
$wpdb->suppress_errors( $this->suppress );
- parent::tearDown();
+ parent::tear_down();
}
public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
diff --git a/tests/phpunit/tests/multisite/site.php b/tests/phpunit/tests/multisite/site.php
index 6f5873b4a2..0311bceaaf 100644
--- a/tests/phpunit/tests/multisite/site.php
+++ b/tests/phpunit/tests/multisite/site.php
@@ -17,16 +17,16 @@ if ( is_multisite() ) :
protected static $site_ids;
protected static $uninitialized_site_id;
- function setUp() {
+ function set_up() {
global $wpdb;
- parent::setUp();
+ parent::set_up();
$this->suppress = $wpdb->suppress_errors();
}
- function tearDown() {
+ function tear_down() {
global $wpdb;
$wpdb->suppress_errors( $this->suppress );
- parent::tearDown();
+ parent::tear_down();
}
public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
diff --git a/tests/phpunit/tests/multisite/siteQuery.php b/tests/phpunit/tests/multisite/siteQuery.php
index 34e8de9020..1a4108c10d 100644
--- a/tests/phpunit/tests/multisite/siteQuery.php
+++ b/tests/phpunit/tests/multisite/siteQuery.php
@@ -14,16 +14,16 @@ if ( is_multisite() ) :
protected $suppress = false;
- function setUp() {
+ function set_up() {
global $wpdb;
- parent::setUp();
+ parent::set_up();
$this->suppress = $wpdb->suppress_errors();
}
- function tearDown() {
+ function tear_down() {
global $wpdb;
$wpdb->suppress_errors( $this->suppress );
- parent::tearDown();
+ parent::tear_down();
}
public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
diff --git a/tests/phpunit/tests/multisite/uploadIsUserOverQuota.php b/tests/phpunit/tests/multisite/uploadIsUserOverQuota.php
index 9326cf93c2..544e632da4 100644
--- a/tests/phpunit/tests/multisite/uploadIsUserOverQuota.php
+++ b/tests/phpunit/tests/multisite/uploadIsUserOverQuota.php
@@ -13,18 +13,18 @@ if ( is_multisite() ) :
class Tests_Multisite_Upload_Is_User_Over_Quota extends WP_UnitTestCase {
protected $suppress = false;
- public function setUp() {
+ public function set_up() {
global $wpdb;
- parent::setUp();
+ parent::set_up();
$this->suppress = $wpdb->suppress_errors();
update_site_option( 'upload_space_check_disabled', false );
}
- public function tearDown() {
+ public function tear_down() {
global $wpdb;
$wpdb->suppress_errors( $this->suppress );
- parent::tearDown();
+ parent::tear_down();
}
public function test_upload_is_user_over_quota_allowed_0_used_5() {
diff --git a/tests/phpunit/tests/multisite/wpMSSitesListTable.php b/tests/phpunit/tests/multisite/wpMSSitesListTable.php
index 6fd22ab214..9b26e35a36 100644
--- a/tests/phpunit/tests/multisite/wpMSSitesListTable.php
+++ b/tests/phpunit/tests/multisite/wpMSSitesListTable.php
@@ -14,8 +14,8 @@ if ( is_multisite() ) :
*/
public $table = false;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->table = _get_list_table( 'WP_MS_Sites_List_Table', array( 'screen' => 'ms-sites' ) );
}
diff --git a/tests/phpunit/tests/oembed/WpEmbed.php b/tests/phpunit/tests/oembed/WpEmbed.php
index 83ca8b58eb..239ea24d56 100644
--- a/tests/phpunit/tests/oembed/WpEmbed.php
+++ b/tests/phpunit/tests/oembed/WpEmbed.php
@@ -9,8 +9,8 @@ class Tests_WP_Embed extends WP_UnitTestCase {
*/
protected $wp_embed;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->wp_embed = new WP_Embed();
}
diff --git a/tests/phpunit/tests/oembed/controller.php b/tests/phpunit/tests/oembed/controller.php
index 8cc9f2b884..768d9c1b4b 100644
--- a/tests/phpunit/tests/oembed/controller.php
+++ b/tests/phpunit/tests/oembed/controller.php
@@ -44,8 +44,8 @@ class Test_oEmbed_Controller extends WP_UnitTestCase {
self::delete_user( self::$editor );
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
/** @var WP_REST_Server $wp_rest_server */
global $wp_rest_server;
@@ -59,12 +59,12 @@ class Test_oEmbed_Controller extends WP_UnitTestCase {
$this->oembed_result_filter_count = 0;
}
- public function tearDown() {
+ public function tear_down() {
/** @var WP_REST_Server $wp_rest_server */
global $wp_rest_server;
$wp_rest_server = null;
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/oembed/getResponseData.php b/tests/phpunit/tests/oembed/getResponseData.php
index 1c6547a6b7..c66de3d01f 100644
--- a/tests/phpunit/tests/oembed/getResponseData.php
+++ b/tests/phpunit/tests/oembed/getResponseData.php
@@ -5,8 +5,8 @@
* @covers ::get_oembed_response_data
*/
class Tests_oEmbed_Response_Data extends WP_UnitTestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
// `get_post_embed_html()` assumes `wp-includes/js/wp-embed.js` is present:
self::touch( ABSPATH . WPINC . '/js/wp-embed.js' );
diff --git a/tests/phpunit/tests/oembed/wpOembed.php b/tests/phpunit/tests/oembed/wpOembed.php
index a2d767e373..051a7efe3d 100644
--- a/tests/phpunit/tests/oembed/wpOembed.php
+++ b/tests/phpunit/tests/oembed/wpOembed.php
@@ -11,8 +11,8 @@ class Tests_WP_oEmbed extends WP_UnitTestCase {
public $pre_oembed_result_filtered = false;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
require_once ABSPATH . WPINC . '/class-wp-oembed.php';
$this->oembed = _wp_oembed_get_object();
diff --git a/tests/phpunit/tests/option/multisite.php b/tests/phpunit/tests/option/multisite.php
index 6f4c7f5b0a..54388d0144 100644
--- a/tests/phpunit/tests/option/multisite.php
+++ b/tests/phpunit/tests/option/multisite.php
@@ -12,16 +12,16 @@ if ( is_multisite() ) :
class Tests_Multisite_Option extends WP_UnitTestCase {
protected $suppress = false;
- function setUp() {
+ function set_up() {
global $wpdb;
- parent::setUp();
+ parent::set_up();
$this->suppress = $wpdb->suppress_errors();
}
- function tearDown() {
+ function tear_down() {
global $wpdb;
$wpdb->suppress_errors( $this->suppress );
- parent::tearDown();
+ parent::tear_down();
}
function test_from_same_site() {
diff --git a/tests/phpunit/tests/option/siteTransient.php b/tests/phpunit/tests/option/siteTransient.php
index f4c9a86c0a..50763f9cfb 100644
--- a/tests/phpunit/tests/option/siteTransient.php
+++ b/tests/phpunit/tests/option/siteTransient.php
@@ -5,8 +5,8 @@
*/
class Tests_Option_SiteTransient extends WP_UnitTestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
if ( wp_using_ext_object_cache() ) {
$this->markTestSkipped( 'Not testable with an external object cache.' );
diff --git a/tests/phpunit/tests/option/slashes.php b/tests/phpunit/tests/option/slashes.php
index 8d7491fe76..74a51428e0 100644
--- a/tests/phpunit/tests/option/slashes.php
+++ b/tests/phpunit/tests/option/slashes.php
@@ -7,8 +7,8 @@
*/
class Tests_Option_Slashes extends WP_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
// It is important to test with both even and odd numbered slashes,
// as KSES does a strip-then-add slashes in some of its function calls.
diff --git a/tests/phpunit/tests/option/transient.php b/tests/phpunit/tests/option/transient.php
index 5f3116a1f4..58dd8c2107 100644
--- a/tests/phpunit/tests/option/transient.php
+++ b/tests/phpunit/tests/option/transient.php
@@ -5,8 +5,8 @@
*/
class Tests_Option_Transient extends WP_UnitTestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
if ( wp_using_ext_object_cache() ) {
$this->markTestSkipped( 'Not testable with an external object cache.' );
diff --git a/tests/phpunit/tests/option/userSettings.php b/tests/phpunit/tests/option/userSettings.php
index e09c226355..596efee2ee 100644
--- a/tests/phpunit/tests/option/userSettings.php
+++ b/tests/phpunit/tests/option/userSettings.php
@@ -2,8 +2,8 @@
class Tests_User_Settings extends WP_UnitTestCase {
protected $user_id;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->user_id = self::factory()->user->create(
array(
@@ -14,10 +14,10 @@ class Tests_User_Settings extends WP_UnitTestCase {
wp_set_current_user( $this->user_id );
}
- function tearDown() {
+ function tear_down() {
unset( $GLOBALS['_updated_user_settings'] );
- parent::tearDown();
+ parent::tear_down();
}
function test_set_user_setting() {
diff --git a/tests/phpunit/tests/option/wpLoadAllOptions.php b/tests/phpunit/tests/option/wpLoadAllOptions.php
index 76c23d29e0..df4fa1aac7 100644
--- a/tests/phpunit/tests/option/wpLoadAllOptions.php
+++ b/tests/phpunit/tests/option/wpLoadAllOptions.php
@@ -7,9 +7,9 @@
class Tests_Option_WP_Load_Alloptions extends WP_UnitTestCase {
protected $alloptions = null;
- function tearDown() {
+ function tear_down() {
$this->alloptions = null;
- parent::tearDown();
+ parent::tear_down();
}
function test_if_alloptions_is_cached() {
diff --git a/tests/phpunit/tests/pomo/noopTranslations.php b/tests/phpunit/tests/pomo/noopTranslations.php
index 13ff9e6187..264aa170e3 100644
--- a/tests/phpunit/tests/pomo/noopTranslations.php
+++ b/tests/phpunit/tests/pomo/noopTranslations.php
@@ -4,8 +4,8 @@
* @group pomo
*/
class Tests_POMO_NOOPTranslations extends WP_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->noop = new NOOP_Translations;
$this->entry = new Translation_Entry( array( 'singular' => 'baba' ) );
$this->plural_entry = new Translation_Entry(
diff --git a/tests/phpunit/tests/pomo/po.php b/tests/phpunit/tests/pomo/po.php
index 8b81ce7e9d..c79b37033f 100644
--- a/tests/phpunit/tests/pomo/po.php
+++ b/tests/phpunit/tests/pomo/po.php
@@ -4,8 +4,8 @@
* @group pomo
*/
class Tests_POMO_PO extends WP_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
require_once ABSPATH . '/wp-includes/pomo/po.php';
// Not so random wordpress.pot string -- multiple lines.
$this->mail = 'Your new WordPress blog has been successfully set up at:
diff --git a/tests/phpunit/tests/post.php b/tests/phpunit/tests/post.php
index 5881165e13..d844b12973 100644
--- a/tests/phpunit/tests/post.php
+++ b/tests/phpunit/tests/post.php
@@ -30,8 +30,8 @@ class Tests_Post extends WP_UnitTestCase {
remove_role( 'grammarian' );
}
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
wp_set_current_user( self::$editor_id );
_set_cron_array( array() );
diff --git a/tests/phpunit/tests/post/attachments.php b/tests/phpunit/tests/post/attachments.php
index 9bab31b771..c3477367f6 100644
--- a/tests/phpunit/tests/post/attachments.php
+++ b/tests/phpunit/tests/post/attachments.php
@@ -7,10 +7,10 @@
*/
class Tests_Post_Attachments extends WP_UnitTestCase {
- function tearDown() {
+ function tear_down() {
// Remove all uploads.
$this->remove_added_uploads();
- parent::tearDown();
+ parent::tear_down();
}
function test_insert_bogus_image() {
diff --git a/tests/phpunit/tests/post/bodyClass.php b/tests/phpunit/tests/post/bodyClass.php
index aee0e1c8cd..60d98ce3e7 100644
--- a/tests/phpunit/tests/post/bodyClass.php
+++ b/tests/phpunit/tests/post/bodyClass.php
@@ -7,8 +7,8 @@
class Tests_Post_BodyClass extends WP_UnitTestCase {
protected $post_id;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->post_id = self::factory()->post->create();
}
diff --git a/tests/phpunit/tests/post/filtering.php b/tests/phpunit/tests/post/filtering.php
index 7a3a0cb5c6..f36e2d700d 100644
--- a/tests/phpunit/tests/post/filtering.php
+++ b/tests/phpunit/tests/post/filtering.php
@@ -10,16 +10,16 @@
* @group formatting
*/
class Tests_Post_Filtering extends WP_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
update_option( 'use_balanceTags', 1 );
kses_init_filters();
}
- function tearDown() {
+ function tear_down() {
kses_remove_filters();
- parent::tearDown();
+ parent::tear_down();
}
// A simple test to make sure unclosed tags are fixed.
diff --git a/tests/phpunit/tests/post/getBodyClass.php b/tests/phpunit/tests/post/getBodyClass.php
index 236d78e2ba..2872218afb 100644
--- a/tests/phpunit/tests/post/getBodyClass.php
+++ b/tests/phpunit/tests/post/getBodyClass.php
@@ -7,8 +7,8 @@
class Tests_Post_GetBodyClass extends WP_UnitTestCase {
protected $post_id;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->post_id = self::factory()->post->create();
}
diff --git a/tests/phpunit/tests/post/getPageChildren.php b/tests/phpunit/tests/post/getPageChildren.php
index c64b7550cf..208fdf3b36 100644
--- a/tests/phpunit/tests/post/getPageChildren.php
+++ b/tests/phpunit/tests/post/getPageChildren.php
@@ -18,8 +18,8 @@ class Tests_Post_GetPageChildren extends WP_UnitTestCase {
* ---- pages[8]
* - pages[5]
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
// Mock page objects.
$this->pages = array(
diff --git a/tests/phpunit/tests/post/getPostClass.php b/tests/phpunit/tests/post/getPostClass.php
index 03ebac49df..faedf73c96 100644
--- a/tests/phpunit/tests/post/getPostClass.php
+++ b/tests/phpunit/tests/post/getPostClass.php
@@ -7,8 +7,8 @@
class Tests_Post_GetPostClass extends WP_UnitTestCase {
protected $post_id;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->post_id = self::factory()->post->create();
}
diff --git a/tests/phpunit/tests/post/nav-menu.php b/tests/phpunit/tests/post/nav-menu.php
index 105e06d1a0..4aca66ac0f 100644
--- a/tests/phpunit/tests/post/nav-menu.php
+++ b/tests/phpunit/tests/post/nav-menu.php
@@ -9,8 +9,8 @@ class Tests_Post_Nav_Menu extends WP_UnitTestCase {
*/
public $menu_id;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->menu_id = wp_create_nav_menu( rand_str() );
}
diff --git a/tests/phpunit/tests/post/output.php b/tests/phpunit/tests/post/output.php
index f5534d535f..ccd2e96622 100644
--- a/tests/phpunit/tests/post/output.php
+++ b/tests/phpunit/tests/post/output.php
@@ -8,16 +8,16 @@
*/
class Tests_Post_Output extends WP_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
add_shortcode( 'dumptag', array( $this, '_shortcode_dumptag' ) );
add_shortcode( 'paragraph', array( $this, '_shortcode_paragraph' ) );
}
- function tearDown() {
+ function tear_down() {
global $shortcode_tags;
unset( $shortcode_tags['dumptag'], $shortcode_tags['paragraph'] );
- parent::tearDown();
+ parent::tear_down();
}
function _shortcode_dumptag( $atts ) {
diff --git a/tests/phpunit/tests/post/postClass.php b/tests/phpunit/tests/post/postClass.php
index 3236e68e26..a3d250eb23 100644
--- a/tests/phpunit/tests/post/postClass.php
+++ b/tests/phpunit/tests/post/postClass.php
@@ -7,8 +7,8 @@
class Tests_Post_PostClass extends WP_UnitTestCase {
protected $post_id;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->post_id = self::factory()->post->create();
}
diff --git a/tests/phpunit/tests/post/revisions.php b/tests/phpunit/tests/post/revisions.php
index ef44af5679..3e0899ca99 100644
--- a/tests/phpunit/tests/post/revisions.php
+++ b/tests/phpunit/tests/post/revisions.php
@@ -15,8 +15,8 @@ class Tests_Post_Revisions extends WP_UnitTestCase {
self::$author_user_id = $factory->user->create( array( 'role' => 'author' ) );
}
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->post_type = rand_str( 20 );
}
diff --git a/tests/phpunit/tests/post/slashes.php b/tests/phpunit/tests/post/slashes.php
index a1bb11577d..2b06ca5414 100644
--- a/tests/phpunit/tests/post/slashes.php
+++ b/tests/phpunit/tests/post/slashes.php
@@ -14,8 +14,8 @@ class Tests_Post_Slashes extends WP_UnitTestCase {
self::$post_id = $factory->post->create();
}
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
wp_set_current_user( self::$author_id );
diff --git a/tests/phpunit/tests/post/thumbnails.php b/tests/phpunit/tests/post/thumbnails.php
index f5fce8ac44..cea33de9ae 100644
--- a/tests/phpunit/tests/post/thumbnails.php
+++ b/tests/phpunit/tests/post/thumbnails.php
@@ -26,9 +26,9 @@ class Tests_Post_Thumbnail_Template extends WP_UnitTestCase {
);
}
- public static function tearDownAfterClass() {
+ public static function tear_down_after_class() {
wp_delete_post( self::$attachment_id, true );
- parent::tearDownAfterClass();
+ parent::tear_down_after_class();
}
function test_has_post_thumbnail() {
diff --git a/tests/phpunit/tests/post/types.php b/tests/phpunit/tests/post/types.php
index ca2cbb8761..a6631d7880 100644
--- a/tests/phpunit/tests/post/types.php
+++ b/tests/phpunit/tests/post/types.php
@@ -18,8 +18,8 @@ class Tests_Post_Types extends WP_UnitTestCase {
*
* @since 4.5.0
*/
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->post_type = rand_str( 20 );
}
diff --git a/tests/phpunit/tests/post/walkerPage.php b/tests/phpunit/tests/post/walkerPage.php
index 14963e9b32..f0ad198d78 100644
--- a/tests/phpunit/tests/post/walkerPage.php
+++ b/tests/phpunit/tests/post/walkerPage.php
@@ -13,8 +13,8 @@ class Tests_Post_Walker_Page extends WP_UnitTestCase {
/**
* Setup.
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
/** Walker_Page class */
require_once ABSPATH . 'wp-includes/class-walker-page.php';
diff --git a/tests/phpunit/tests/post/wpAfterInsertPost.php b/tests/phpunit/tests/post/wpAfterInsertPost.php
index d4dc826461..b4a5f52d91 100644
--- a/tests/phpunit/tests/post/wpAfterInsertPost.php
+++ b/tests/phpunit/tests/post/wpAfterInsertPost.php
@@ -78,17 +78,17 @@ class Tests_Post_wpAfterInsertPost extends WP_UnitTestCase {
);
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
add_action( 'wp_after_insert_post', array( $this, 'action_wp_after_insert_post' ), 10, 4 );
}
- public function tearDown() {
+ public function tear_down() {
self::$passed_post_title = '';
self::$passed_post_status = '';
self::$passed_post_before_title = '';
self::$passed_post_before_status = '';
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/post/wpInsertPost.php b/tests/phpunit/tests/post/wpInsertPost.php
index d43d9ba864..51ade49127 100644
--- a/tests/phpunit/tests/post/wpInsertPost.php
+++ b/tests/phpunit/tests/post/wpInsertPost.php
@@ -29,16 +29,16 @@ class Tests_Post_wpInsertPost extends WP_UnitTestCase {
$role->add_cap( 'publish_unmapped_meta_caps' );
}
- static function tearDownAfterClass() {
+ static function tear_down_after_class() {
$role = get_role( 'administrator' );
$role->remove_cap( 'publish_mapped_meta_caps' );
$role->remove_cap( 'publish_unmapped_meta_caps' );
- parent::tearDownAfterClass();
+ parent::tear_down_after_class();
}
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
register_post_type(
'mapped_meta_caps',
diff --git a/tests/phpunit/tests/privacy/wpPrivacyDeleteOldExportFiles.php b/tests/phpunit/tests/privacy/wpPrivacyDeleteOldExportFiles.php
index e4e3d42066..8694468268 100644
--- a/tests/phpunit/tests/privacy/wpPrivacyDeleteOldExportFiles.php
+++ b/tests/phpunit/tests/privacy/wpPrivacyDeleteOldExportFiles.php
@@ -63,8 +63,8 @@ class Tests_Privacy_wpPrivacyDeleteOldExportFiles extends WP_UnitTestCase {
/**
* Perform setup operations that are shared across all tests.
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
touch( self::$index_path, time() - 30 * WEEK_IN_SECONDS );
touch( self::$expired_export_file, time() - 5 * DAY_IN_SECONDS );
diff --git a/tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php b/tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php
index e86f9c0253..a322778941 100644
--- a/tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php
+++ b/tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php
@@ -63,8 +63,8 @@ class Tests_Privacy_wpPrivacyGeneratePersonalDataExportFile extends WP_UnitTestC
*
* @since 5.2.0
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->export_file_name = '';
@@ -93,10 +93,10 @@ class Tests_Privacy_wpPrivacyGeneratePersonalDataExportFile extends WP_UnitTestC
*
* @since 5.2.0
*/
- public function tearDown() {
+ public function tear_down() {
$this->remove_exports_dir();
error_reporting( $this->_error_level );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php b/tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php
index 367d289773..9653c79818 100644
--- a/tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php
+++ b/tests/phpunit/tests/privacy/wpPrivacyProcessPersonalDataExportPage.php
@@ -191,8 +191,8 @@ class Tests_Privacy_wpPrivacyProcessPersonalDataExportPage extends WP_UnitTestCa
*
* @since 5.2.0
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
// Avoid writing export files to disk. Using `WP_Filesystem_MockFS` is blocked by #44204.
remove_action( 'wp_privacy_personal_data_export_file', 'wp_privacy_generate_personal_data_export_file', 10 );
@@ -218,10 +218,10 @@ class Tests_Privacy_wpPrivacyProcessPersonalDataExportPage extends WP_UnitTestCa
*
* @since 5.2.0
*/
- public function tearDown() {
+ public function tear_down() {
error_reporting( $this->_error_level );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php b/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php
index d072588b5e..96b4e0ecd9 100644
--- a/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php
+++ b/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php
@@ -88,8 +88,8 @@ class Tests_Privacy_wpPrivacySendErasureFulfillmentNotification extends WP_UnitT
*
* @since 5.1.0
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
reset_phpmailer_instance();
}
@@ -98,10 +98,10 @@ class Tests_Privacy_wpPrivacySendErasureFulfillmentNotification extends WP_UnitT
*
* @since 5.1.0
*/
- public function tearDown() {
+ public function tear_down() {
reset_phpmailer_instance();
restore_previous_locale();
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/privacy/wpPrivacySendPersonalDataExportEmail.php b/tests/phpunit/tests/privacy/wpPrivacySendPersonalDataExportEmail.php
index 4a7ab1ca96..5c9336ad97 100644
--- a/tests/phpunit/tests/privacy/wpPrivacySendPersonalDataExportEmail.php
+++ b/tests/phpunit/tests/privacy/wpPrivacySendPersonalDataExportEmail.php
@@ -57,8 +57,8 @@ class Tests_Privacy_wpPrivacySendPersonalDataExportEmail extends WP_UnitTestCase
*
* @since 4.9.6
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
reset_phpmailer_instance();
}
@@ -67,10 +67,10 @@ class Tests_Privacy_wpPrivacySendPersonalDataExportEmail extends WP_UnitTestCase
*
* @since 4.9.6
*/
- public function tearDown() {
+ public function tear_down() {
reset_phpmailer_instance();
restore_previous_locale();
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php b/tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php
index 5f3947e6ac..f2933bdda0 100644
--- a/tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php
+++ b/tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php
@@ -22,8 +22,8 @@ class Tests_Privacy_wpPrivacySendRequestConfirmationNotification extends WP_Unit
*
* @since 4.9.8
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
reset_phpmailer_instance();
}
@@ -32,9 +32,9 @@ class Tests_Privacy_wpPrivacySendRequestConfirmationNotification extends WP_Unit
*
* @since 4.9.8
*/
- public function tearDown() {
+ public function tear_down() {
reset_phpmailer_instance();
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/query.php b/tests/phpunit/tests/query.php
index 4784432a8c..4032c62571 100644
--- a/tests/phpunit/tests/query.php
+++ b/tests/phpunit/tests/query.php
@@ -2,8 +2,8 @@
class Tests_Query extends WP_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
create_initial_taxonomies();
diff --git a/tests/phpunit/tests/query/commentCount.php b/tests/phpunit/tests/query/commentCount.php
index 6c1b85eb5b..5c8bd2df26 100644
--- a/tests/phpunit/tests/query/commentCount.php
+++ b/tests/phpunit/tests/query/commentCount.php
@@ -7,15 +7,15 @@ class Tests_Query_CommentCount extends WP_UnitTestCase {
public $q;
public static $post_type = 'page'; // Can be anything.
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
unset( $this->q );
$this->q = new WP_Query();
}
- public function tearDown() {
+ public function tear_down() {
unset( $this->q );
- parent::tearDown();
+ parent::tear_down();
}
public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
diff --git a/tests/phpunit/tests/query/conditionals.php b/tests/phpunit/tests/query/conditionals.php
index 2fb22f50c7..46f6b9e285 100644
--- a/tests/phpunit/tests/query/conditionals.php
+++ b/tests/phpunit/tests/query/conditionals.php
@@ -14,8 +14,8 @@ class Tests_Query_Conditionals extends WP_UnitTestCase {
protected $page_ids;
protected $post_ids;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
update_option( 'comments_per_page', 5 );
update_option( 'posts_per_page', 5 );
diff --git a/tests/phpunit/tests/query/date.php b/tests/phpunit/tests/query/date.php
index 873509f96c..d54f8af77c 100644
--- a/tests/phpunit/tests/query/date.php
+++ b/tests/phpunit/tests/query/date.php
@@ -45,8 +45,8 @@ class Tests_Query_Date extends WP_UnitTestCase {
}
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
unset( $this->q );
$this->q = new WP_Query();
}
diff --git a/tests/phpunit/tests/query/dateQuery.php b/tests/phpunit/tests/query/dateQuery.php
index 777dec9958..a43e19f2b6 100644
--- a/tests/phpunit/tests/query/dateQuery.php
+++ b/tests/phpunit/tests/query/dateQuery.php
@@ -13,8 +13,8 @@ class Tests_Query_DateQuery extends WP_UnitTestCase {
public $q;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
unset( $this->q );
$this->q = new WP_Query();
}
diff --git a/tests/phpunit/tests/query/invalidQueries.php b/tests/phpunit/tests/query/invalidQueries.php
index cce03cdc68..ea18617b28 100644
--- a/tests/phpunit/tests/query/invalidQueries.php
+++ b/tests/phpunit/tests/query/invalidQueries.php
@@ -62,8 +62,8 @@ class Tests_Query_InvalidQueries extends WP_UnitTestCase {
/**
* Set up prior to each test.
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
// Clean up variable before each test.
self::$last_posts_request = '';
diff --git a/tests/phpunit/tests/query/isTerm.php b/tests/phpunit/tests/query/isTerm.php
index 822d57147c..23b00d34a5 100644
--- a/tests/phpunit/tests/query/isTerm.php
+++ b/tests/phpunit/tests/query/isTerm.php
@@ -22,8 +22,8 @@ class Tests_Query_IsTerm extends WP_UnitTestCase {
protected $tag;
protected $tax;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$GLOBALS['wp_the_query'] = new WP_Query();
$GLOBALS['wp_query'] = $GLOBALS['wp_the_query'];
diff --git a/tests/phpunit/tests/query/postStatus.php b/tests/phpunit/tests/query/postStatus.php
index f8700c0593..1ab8aa849d 100644
--- a/tests/phpunit/tests/query/postStatus.php
+++ b/tests/phpunit/tests/query/postStatus.php
@@ -78,8 +78,8 @@ class Tests_Query_PostStatus extends WP_UnitTestCase {
);
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
self::register_custom_post_objects();
}
diff --git a/tests/phpunit/tests/query/results.php b/tests/phpunit/tests/query/results.php
index deefd7840b..1a690b49f3 100644
--- a/tests/phpunit/tests/query/results.php
+++ b/tests/phpunit/tests/query/results.php
@@ -294,8 +294,8 @@ class Tests_Query_Results extends WP_UnitTestCase {
self::$post_ids[] = self::$child_four;
}
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
unset( $this->q );
$this->q = new WP_Query();
diff --git a/tests/phpunit/tests/query/search.php b/tests/phpunit/tests/query/search.php
index e42053d850..1cc35f4a21 100644
--- a/tests/phpunit/tests/query/search.php
+++ b/tests/phpunit/tests/query/search.php
@@ -7,8 +7,8 @@ class Tests_Query_Search extends WP_UnitTestCase {
protected $q;
protected $post_type;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->post_type = rand_str( 12 );
register_post_type( $this->post_type );
@@ -16,10 +16,10 @@ class Tests_Query_Search extends WP_UnitTestCase {
$this->q = new WP_Query();
}
- function tearDown() {
+ function tear_down() {
unset( $this->q );
- parent::tearDown();
+ parent::tear_down();
}
function get_search_results( $terms ) {
diff --git a/tests/phpunit/tests/query/verboseRewriteRules.php b/tests/phpunit/tests/query/verboseRewriteRules.php
index 88f2ef38ac..c7f7c057b8 100644
--- a/tests/phpunit/tests/query/verboseRewriteRules.php
+++ b/tests/phpunit/tests/query/verboseRewriteRules.php
@@ -7,8 +7,8 @@ require_once __DIR__ . '/conditionals.php';
* @group rewrite
*/
class Tests_Query_VerbosePageRules extends Tests_Query_Conditionals {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->set_permalink_structure( '/%category%/%year%/%postname%/' );
create_initial_taxonomies();
diff --git a/tests/phpunit/tests/rest-api.php b/tests/phpunit/tests/rest-api.php
index 98ee8a624d..288c7140e8 100644
--- a/tests/phpunit/tests/rest-api.php
+++ b/tests/phpunit/tests/rest-api.php
@@ -14,17 +14,17 @@ require_once __DIR__ . '/../includes/class-jsonserializable-object.php';
* @group restapi
*/
class Tests_REST_API extends WP_UnitTestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
// Override the normal server with our spying server.
$GLOBALS['wp_rest_server'] = new Spy_REST_Server();
do_action( 'rest_api_init', $GLOBALS['wp_rest_server'] );
}
- public function tearDown() {
+ public function tear_down() {
remove_filter( 'wp_rest_server_class', array( $this, 'filter_wp_rest_server_class' ) );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/rest-api/rest-application-passwords-controller.php b/tests/phpunit/tests/rest-api/rest-application-passwords-controller.php
index 91ed93939a..ac07737b4d 100644
--- a/tests/phpunit/tests/rest-api/rest-application-passwords-controller.php
+++ b/tests/phpunit/tests/rest-api/rest-application-passwords-controller.php
@@ -63,15 +63,15 @@ class WP_Test_REST_Application_Passwords_Controller extends WP_Test_REST_Control
self::delete_user( self::$admin );
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
add_filter( 'wp_is_application_passwords_available', '__return_true' );
}
- public function tearDown() {
+ public function tear_down() {
unset( $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'], $GLOBALS['wp_rest_application_password_status'], $GLOBALS['wp_rest_application_password_uuid'] );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/rest-api/rest-attachments-controller.php b/tests/phpunit/tests/rest-api/rest-attachments-controller.php
index 006e9f7834..14c1f08075 100644
--- a/tests/phpunit/tests/rest-api/rest-attachments-controller.php
+++ b/tests/phpunit/tests/rest-api/rest-attachments-controller.php
@@ -69,8 +69,8 @@ class WP_Test_REST_Attachments_Controller extends WP_Test_REST_Post_Type_Control
self::delete_user( self::$uploader_id );
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
// Add an uploader role to test upload capabilities.
add_role( 'uploader', 'File upload role' );
@@ -87,7 +87,7 @@ class WP_Test_REST_Attachments_Controller extends WP_Test_REST_Post_Type_Control
copy( $orig_file2, $this->test_file2 );
}
- public function tearDown() {
+ public function tear_down() {
if ( file_exists( $this->test_file ) ) {
unlink( $this->test_file );
}
@@ -103,7 +103,7 @@ class WP_Test_REST_Attachments_Controller extends WP_Test_REST_Post_Type_Control
WP_Image_Editor_Mock::$size_return = null;
}
- parent::tearDown();
+ parent::tear_down();
}
public function test_register_routes() {
diff --git a/tests/phpunit/tests/rest-api/rest-autosaves-controller.php b/tests/phpunit/tests/rest-api/rest-autosaves-controller.php
index 39b7836b3e..cf85a864be 100644
--- a/tests/phpunit/tests/rest-api/rest-autosaves-controller.php
+++ b/tests/phpunit/tests/rest-api/rest-autosaves-controller.php
@@ -119,8 +119,8 @@ class WP_Test_REST_Autosaves_Controller extends WP_Test_REST_Post_Type_Controlle
self::delete_user( self::$contributor_id );
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
wp_set_current_user( self::$editor_id );
$this->post_autosave = wp_get_post_autosave( self::$post_id );
diff --git a/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php b/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php
index 50d9cf79eb..6d76a2f5d6 100644
--- a/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php
+++ b/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php
@@ -132,8 +132,8 @@ class REST_Block_Renderer_Controller_Test extends WP_Test_REST_Controller_Testca
*
* @since 5.0.0
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->register_test_block();
$this->register_post_context_test_block();
@@ -146,12 +146,12 @@ class REST_Block_Renderer_Controller_Test extends WP_Test_REST_Controller_Testca
*
* @since 5.0.0
*/
- public function tearDown() {
+ public function tear_down() {
WP_Block_Type_Registry::get_instance()->unregister( self::$block_name );
WP_Block_Type_Registry::get_instance()->unregister( self::$context_block_name );
WP_Block_Type_Registry::get_instance()->unregister( self::$non_dynamic_block_name );
WP_Block_Type_Registry::get_instance()->unregister( self::$dynamic_block_with_boolean_attributes_block_name );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/rest-api/rest-categories-controller.php b/tests/phpunit/tests/rest-api/rest-categories-controller.php
index c5a2cf14c7..3111371599 100644
--- a/tests/phpunit/tests/rest-api/rest-categories-controller.php
+++ b/tests/phpunit/tests/rest-api/rest-categories-controller.php
@@ -56,8 +56,8 @@ class WP_Test_REST_Categories_Controller extends WP_Test_REST_Controller_Testcas
}
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
register_meta(
'term',
diff --git a/tests/phpunit/tests/rest-api/rest-comments-controller.php b/tests/phpunit/tests/rest-api/rest-comments-controller.php
index 7cd9203db8..0c7ed625b7 100644
--- a/tests/phpunit/tests/rest-api/rest-comments-controller.php
+++ b/tests/phpunit/tests/rest-api/rest-comments-controller.php
@@ -150,8 +150,8 @@ class WP_Test_REST_Comments_Controller extends WP_Test_REST_Controller_Testcase
}
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->endpoint = new WP_REST_Comments_Controller;
if ( is_multisite() ) {
update_site_option( 'site_admins', array( 'superadmin' ) );
diff --git a/tests/phpunit/tests/rest-api/rest-controller.php b/tests/phpunit/tests/rest-api/rest-controller.php
index eee484aa72..0af9460aa5 100644
--- a/tests/phpunit/tests/rest-api/rest-controller.php
+++ b/tests/phpunit/tests/rest-api/rest-controller.php
@@ -16,8 +16,8 @@ class WP_Test_REST_Controller extends WP_Test_REST_TestCase {
require_once __DIR__ . '/rest-test-controller.php';
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->request = new WP_REST_Request(
'GET',
'/wp/v2/testroute',
@@ -57,11 +57,11 @@ class WP_Test_REST_Controller extends WP_Test_REST_TestCase {
);
}
- public function tearDown() {
+ public function tear_down() {
global $wp_rest_additional_fields;
$wp_rest_additional_fields = array();
- parent::tearDown();
+ parent::tear_down();
}
public function test_validate_schema_type_integer() {
diff --git a/tests/phpunit/tests/rest-api/rest-pages-controller.php b/tests/phpunit/tests/rest-api/rest-pages-controller.php
index aefc0452f2..00047cce80 100644
--- a/tests/phpunit/tests/rest-api/rest-pages-controller.php
+++ b/tests/phpunit/tests/rest-api/rest-pages-controller.php
@@ -25,8 +25,8 @@ class WP_Test_REST_Pages_Controller extends WP_Test_REST_Post_Type_Controller_Te
self::delete_user( self::$editor_id );
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->has_setup_template = false;
add_filter( 'theme_page_templates', array( $this, 'filter_theme_page_templates' ) );
// Re-register the route as we now have a template available.
diff --git a/tests/phpunit/tests/rest-api/rest-plugins-controller.php b/tests/phpunit/tests/rest-api/rest-plugins-controller.php
index 4bfda0b3c6..e2a61d605b 100644
--- a/tests/phpunit/tests/rest-api/rest-plugins-controller.php
+++ b/tests/phpunit/tests/rest-api/rest-plugins-controller.php
@@ -82,7 +82,7 @@ class WP_REST_Plugins_Controller_Test extends WP_Test_REST_Controller_Testcase {
self::delete_user( self::$admin );
}
- public function tearDown() {
+ public function tear_down() {
if ( file_exists( WP_PLUGIN_DIR . '/test-plugin/test-plugin.php' ) ) {
$this->rmdir( WP_PLUGIN_DIR . '/test-plugin' );
}
@@ -90,7 +90,7 @@ class WP_REST_Plugins_Controller_Test extends WP_Test_REST_Controller_Testcase {
unlink( DIR_TESTDATA . '/link-manager.zip' );
}
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/rest-api/rest-post-meta-fields.php b/tests/phpunit/tests/rest-api/rest-post-meta-fields.php
index ec73681a79..a3450907ac 100644
--- a/tests/phpunit/tests/rest-api/rest-post-meta-fields.php
+++ b/tests/phpunit/tests/rest-api/rest-post-meta-fields.php
@@ -36,8 +36,8 @@ class WP_Test_REST_Post_Meta_Fields extends WP_Test_REST_TestCase {
unregister_post_type( 'cpt' );
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
register_meta(
'post',
diff --git a/tests/phpunit/tests/rest-api/rest-posts-controller.php b/tests/phpunit/tests/rest-api/rest-posts-controller.php
index f330fefe2c..ba6dc53c0b 100644
--- a/tests/phpunit/tests/rest-api/rest-posts-controller.php
+++ b/tests/phpunit/tests/rest-api/rest-posts-controller.php
@@ -97,8 +97,8 @@ class WP_Test_REST_Posts_Controller extends WP_Test_REST_Post_Type_Controller_Te
self::delete_user( self::$private_reader_id );
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
register_post_type(
'youseeme',
array(
@@ -5154,12 +5154,12 @@ class WP_Test_REST_Posts_Controller extends WP_Test_REST_Post_Type_Controller_Te
$GLOBALS['wp_rest_server']->override_by_default = false;
}
- public function tearDown() {
+ public function tear_down() {
if ( isset( $this->attachment_id ) ) {
$this->remove_added_uploads();
}
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/rest-api/rest-request.php b/tests/phpunit/tests/rest-api/rest-request.php
index f5b3a91258..e0e8f5b3bd 100644
--- a/tests/phpunit/tests/rest-api/rest-request.php
+++ b/tests/phpunit/tests/rest-api/rest-request.php
@@ -12,8 +12,8 @@
class Tests_REST_Request extends WP_UnitTestCase {
public $request;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->request = new WP_REST_Request();
}
diff --git a/tests/phpunit/tests/rest-api/rest-revisions-controller.php b/tests/phpunit/tests/rest-api/rest-revisions-controller.php
index da36adae1c..37a529f763 100644
--- a/tests/phpunit/tests/rest-api/rest-revisions-controller.php
+++ b/tests/phpunit/tests/rest-api/rest-revisions-controller.php
@@ -62,8 +62,8 @@ class WP_Test_REST_Revisions_Controller extends WP_Test_REST_Controller_Testcase
self::delete_user( self::$contributor_id );
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$revisions = wp_get_post_revisions( self::$post_id );
$this->total_revisions = count( $revisions );
diff --git a/tests/phpunit/tests/rest-api/rest-schema-setup.php b/tests/phpunit/tests/rest-api/rest-schema-setup.php
index 3754705b28..8f5a15a68b 100644
--- a/tests/phpunit/tests/rest-api/rest-schema-setup.php
+++ b/tests/phpunit/tests/rest-api/rest-schema-setup.php
@@ -15,8 +15,8 @@
class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase {
const YOUTUBE_VIDEO_ID = 'i_cVJgIz_Cs';
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
/** @var WP_REST_Server $wp_rest_server */
global $wp_rest_server;
@@ -26,12 +26,12 @@ class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase {
add_filter( 'pre_http_request', array( $this, 'mock_embed_request' ), 10, 3 );
}
- public function tearDown() {
+ public function tear_down() {
/** @var WP_REST_Server $wp_rest_server */
global $wp_rest_server;
$wp_rest_server = null;
- parent::tearDown();
+ parent::tear_down();
}
public function mock_embed_request( $preempt, $r, $url ) {
diff --git a/tests/phpunit/tests/rest-api/rest-server.php b/tests/phpunit/tests/rest-api/rest-server.php
index 435675e287..a523cc88c9 100644
--- a/tests/phpunit/tests/rest-api/rest-server.php
+++ b/tests/phpunit/tests/rest-api/rest-server.php
@@ -10,8 +10,8 @@
* @group restapi
*/
class Tests_REST_Server extends WP_Test_REST_TestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
// Reset REST server to ensure only our routes are registered.
$GLOBALS['wp_rest_server'] = null;
@@ -20,12 +20,12 @@ class Tests_REST_Server extends WP_Test_REST_TestCase {
remove_filter( 'wp_rest_server_class', array( $this, 'filter_wp_rest_server_class' ) );
}
- public function tearDown() {
+ public function tear_down() {
// Remove our temporary spy server.
$GLOBALS['wp_rest_server'] = null;
unset( $_REQUEST['_wpnonce'] );
- parent::tearDown();
+ parent::tear_down();
}
public function test_envelope() {
diff --git a/tests/phpunit/tests/rest-api/rest-settings-controller.php b/tests/phpunit/tests/rest-api/rest-settings-controller.php
index 8270536c68..bb9a4bbdb6 100644
--- a/tests/phpunit/tests/rest-api/rest-settings-controller.php
+++ b/tests/phpunit/tests/rest-api/rest-settings-controller.php
@@ -33,12 +33,12 @@ class WP_Test_REST_Settings_Controller extends WP_Test_REST_Controller_Testcase
self::delete_user( self::$author );
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->endpoint = new WP_REST_Settings_Controller();
}
- public function tearDown() {
+ public function tear_down() {
$settings_to_unregister = array(
'mycustomsetting',
'mycustomsetting1',
@@ -54,7 +54,7 @@ class WP_Test_REST_Settings_Controller extends WP_Test_REST_Controller_Testcase
}
}
- parent::tearDown();
+ parent::tear_down();
}
public function test_register_routes() {
diff --git a/tests/phpunit/tests/rest-api/rest-sidebars-controller.php b/tests/phpunit/tests/rest-api/rest-sidebars-controller.php
index 5500c054a7..850210cc20 100644
--- a/tests/phpunit/tests/rest-api/rest-sidebars-controller.php
+++ b/tests/phpunit/tests/rest-api/rest-sidebars-controller.php
@@ -50,8 +50,8 @@ class WP_Test_REST_Sidebars_Controller extends WP_Test_REST_Controller_Testcase
wp_delete_user( self::$author_id );
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
wp_set_current_user( self::$admin_id );
diff --git a/tests/phpunit/tests/rest-api/rest-tags-controller.php b/tests/phpunit/tests/rest-api/rest-tags-controller.php
index 143ef50a7c..6ec4bbb689 100644
--- a/tests/phpunit/tests/rest-api/rest-tags-controller.php
+++ b/tests/phpunit/tests/rest-api/rest-tags-controller.php
@@ -74,8 +74,8 @@ class WP_Test_REST_Tags_Controller extends WP_Test_REST_Controller_Testcase {
}
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
register_meta(
'term',
diff --git a/tests/phpunit/tests/rest-api/rest-term-meta-fields.php b/tests/phpunit/tests/rest-api/rest-term-meta-fields.php
index a17b813f9b..0087226ede 100644
--- a/tests/phpunit/tests/rest-api/rest-term-meta-fields.php
+++ b/tests/phpunit/tests/rest-api/rest-term-meta-fields.php
@@ -36,8 +36,8 @@ class WP_Test_REST_Term_Meta_Fields extends WP_Test_REST_TestCase {
unregister_taxonomy( 'customtax' );
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
register_meta(
'term',
diff --git a/tests/phpunit/tests/rest-api/rest-themes-controller.php b/tests/phpunit/tests/rest-api/rest-themes-controller.php
index b8b864a6a7..5acbf7d0f9 100644
--- a/tests/phpunit/tests/rest-api/rest-themes-controller.php
+++ b/tests/phpunit/tests/rest-api/rest-themes-controller.php
@@ -136,8 +136,8 @@ class WP_Test_REST_Themes_Controller extends WP_Test_REST_Controller_Testcase {
*
* @since 5.0.0
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
wp_set_current_user( self::$contributor_id );
switch_theme( 'rest-api' );
diff --git a/tests/phpunit/tests/rest-api/rest-users-controller.php b/tests/phpunit/tests/rest-api/rest-users-controller.php
index 4d06f99a15..1705cba2eb 100644
--- a/tests/phpunit/tests/rest-api/rest-users-controller.php
+++ b/tests/phpunit/tests/rest-api/rest-users-controller.php
@@ -148,8 +148,8 @@ class WP_Test_REST_Users_Controller extends WP_Test_REST_Controller_Testcase {
/**
* This function is run before each method
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->endpoint = new WP_REST_Users_Controller();
}
diff --git a/tests/phpunit/tests/rest-api/rest-widgets-controller.php b/tests/phpunit/tests/rest-api/rest-widgets-controller.php
index e455954c33..66f14739b9 100644
--- a/tests/phpunit/tests/rest-api/rest-widgets-controller.php
+++ b/tests/phpunit/tests/rest-api/rest-widgets-controller.php
@@ -94,10 +94,10 @@ class WP_Test_REST_Widgets_Controller extends WP_Test_REST_Controller_Testcase {
);
}
- public function setUp() {
+ public function set_up() {
global $wp_widget_factory;
- parent::setUp();
+ parent::set_up();
wp_set_current_user( self::$admin_id );
diff --git a/tests/phpunit/tests/rewrite.php b/tests/phpunit/tests/rewrite.php
index 11b55a850a..8f54a0dc89 100644
--- a/tests/phpunit/tests/rewrite.php
+++ b/tests/phpunit/tests/rewrite.php
@@ -8,8 +8,8 @@
class Tests_Rewrite extends WP_UnitTestCase {
private $home_url;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
create_initial_taxonomies();
@@ -17,12 +17,12 @@ class Tests_Rewrite extends WP_UnitTestCase {
$this->home_url = get_option( 'home' );
}
- function tearDown() {
+ function tear_down() {
global $wp_rewrite;
$wp_rewrite->init();
update_option( 'home', $this->home_url );
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/rewrite/addRewriteEndpoint.php b/tests/phpunit/tests/rewrite/addRewriteEndpoint.php
index 149566b669..0c4c7a332d 100644
--- a/tests/phpunit/tests/rewrite/addRewriteEndpoint.php
+++ b/tests/phpunit/tests/rewrite/addRewriteEndpoint.php
@@ -17,17 +17,17 @@ class Tests_Rewrite_AddRewriteEndpoint extends WP_UnitTestCase {
self::$test_post_id = $factory->post->create();
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
$this->qvs = $GLOBALS['wp']->public_query_vars;
}
- public function tearDown() {
+ public function tear_down() {
$GLOBALS['wp']->public_query_vars = $this->qvs;
- parent::tearDown();
+ parent::tear_down();
}
public function test_should_register_query_using_name_param_by_default() {
diff --git a/tests/phpunit/tests/rewrite/addRewriteRule.php b/tests/phpunit/tests/rewrite/addRewriteRule.php
index b1d6987d5a..02efc7bd0a 100644
--- a/tests/phpunit/tests/rewrite/addRewriteRule.php
+++ b/tests/phpunit/tests/rewrite/addRewriteRule.php
@@ -5,8 +5,8 @@
*/
class Tests_Rewrite_AddRewriteRule extends WP_UnitTestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->set_permalink_structure( '/%postname%/' );
}
diff --git a/tests/phpunit/tests/rewrite/numericSlugs.php b/tests/phpunit/tests/rewrite/numericSlugs.php
index 1c547edea4..e11c6b2a46 100644
--- a/tests/phpunit/tests/rewrite/numericSlugs.php
+++ b/tests/phpunit/tests/rewrite/numericSlugs.php
@@ -7,8 +7,8 @@
class Tests_Rewrite_NumericSlugs extends WP_UnitTestCase {
private $old_current_user;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->author_id = self::factory()->user->create( array( 'role' => 'editor' ) );
// Override the post/archive slug collision prevention in `wp_unique_post_slug()`.
diff --git a/tests/phpunit/tests/rewrite/oldDateRedirect.php b/tests/phpunit/tests/rewrite/oldDateRedirect.php
index d413006b5a..7f4519875d 100644
--- a/tests/phpunit/tests/rewrite/oldDateRedirect.php
+++ b/tests/phpunit/tests/rewrite/oldDateRedirect.php
@@ -28,8 +28,8 @@ class Tests_Rewrite_OldDateRedirect extends WP_UnitTestCase {
);
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
add_filter( 'old_slug_redirect_url', array( $this, 'filter_old_date_redirect_url' ), 10, 1 );
@@ -41,10 +41,10 @@ class Tests_Rewrite_OldDateRedirect extends WP_UnitTestCase {
flush_rewrite_rules();
}
- public function tearDown() {
+ public function tear_down() {
$this->old_date_redirect_url = null;
- parent::tearDown();
+ parent::tear_down();
}
public function test_old_date_redirect() {
diff --git a/tests/phpunit/tests/rewrite/oldSlugRedirect.php b/tests/phpunit/tests/rewrite/oldSlugRedirect.php
index 724e698bb1..2083f9bcce 100644
--- a/tests/phpunit/tests/rewrite/oldSlugRedirect.php
+++ b/tests/phpunit/tests/rewrite/oldSlugRedirect.php
@@ -9,8 +9,8 @@ class Tests_Rewrite_OldSlugRedirect extends WP_UnitTestCase {
protected $post_id;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->post_id = self::factory()->post->create(
array(
@@ -29,10 +29,10 @@ class Tests_Rewrite_OldSlugRedirect extends WP_UnitTestCase {
flush_rewrite_rules();
}
- public function tearDown() {
+ public function tear_down() {
$this->old_slug_redirect_url = null;
- parent::tearDown();
+ parent::tear_down();
}
public function test_old_slug_redirect() {
diff --git a/tests/phpunit/tests/rewrite/permastructs.php b/tests/phpunit/tests/rewrite/permastructs.php
index f2fde194af..4e2bc0594b 100644
--- a/tests/phpunit/tests/rewrite/permastructs.php
+++ b/tests/phpunit/tests/rewrite/permastructs.php
@@ -5,8 +5,8 @@
*/
class Tests_Rewrite_Permastructs extends WP_UnitTestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->set_permalink_structure( '/%postname%/' );
}
diff --git a/tests/phpunit/tests/rewrite/rewriteTags.php b/tests/phpunit/tests/rewrite/rewriteTags.php
index 5afd25728a..8eeef7f7d9 100644
--- a/tests/phpunit/tests/rewrite/rewriteTags.php
+++ b/tests/phpunit/tests/rewrite/rewriteTags.php
@@ -8,9 +8,9 @@ class Tests_Rewrite_Tags extends WP_UnitTestCase {
protected $rewritereplace;
protected $queryreplace;
- public function setUp() {
+ public function set_up() {
global $wp_rewrite;
- parent::setUp();
+ parent::set_up();
$wp_rewrite = new WP_Rewrite();
$wp_rewrite->init();
diff --git a/tests/phpunit/tests/robots.php b/tests/phpunit/tests/robots.php
index bf715e8568..9d71480af2 100644
--- a/tests/phpunit/tests/robots.php
+++ b/tests/phpunit/tests/robots.php
@@ -12,8 +12,8 @@
*/
class Tests_Robots extends WP_UnitTestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
remove_all_filters( 'wp_robots' );
}
diff --git a/tests/phpunit/tests/shortcode.php b/tests/phpunit/tests/shortcode.php
index 01b022ec67..479f6d059a 100644
--- a/tests/phpunit/tests/shortcode.php
+++ b/tests/phpunit/tests/shortcode.php
@@ -6,8 +6,8 @@ class Tests_Shortcode extends WP_UnitTestCase {
protected $shortcodes = array( 'test-shortcode-tag', 'footag', 'bartag', 'baztag', 'dumptag', 'hyphen', 'hyphen-foo', 'hyphen-foo-bar', 'url', 'img' );
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
foreach ( $this->shortcodes as $shortcode ) {
add_shortcode( $shortcode, array( $this, '_shortcode_' . str_replace( '-', '_', $shortcode ) ) );
@@ -19,12 +19,12 @@ class Tests_Shortcode extends WP_UnitTestCase {
}
- function tearDown() {
+ function tear_down() {
global $shortcode_tags;
foreach ( $this->shortcodes as $shortcode ) {
unset( $shortcode_tags[ $shortcode ] );
}
- parent::tearDown();
+ parent::tear_down();
}
function _shortcode_test_shortcode_tag( $atts, $content = null, $tagname = null ) {
diff --git a/tests/phpunit/tests/taxonomy/getObjectTaxonomies.php b/tests/phpunit/tests/taxonomy/getObjectTaxonomies.php
index b38f3f994c..75bcd7a2a1 100644
--- a/tests/phpunit/tests/taxonomy/getObjectTaxonomies.php
+++ b/tests/phpunit/tests/taxonomy/getObjectTaxonomies.php
@@ -4,8 +4,8 @@
* @group taxonomy
*/
class Tests_Taxonomy_GetObjectTaxonomies extends WP_UnitTestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
register_post_type( 'wptests_pt' );
register_taxonomy( 'wptests_tax', 'wptests_pt' );
}
diff --git a/tests/phpunit/tests/taxonomy/isTaxonomyViewable.php b/tests/phpunit/tests/taxonomy/isTaxonomyViewable.php
index 7d5c4222f5..ec2d0dbe7a 100644
--- a/tests/phpunit/tests/taxonomy/isTaxonomyViewable.php
+++ b/tests/phpunit/tests/taxonomy/isTaxonomyViewable.php
@@ -4,8 +4,8 @@
* @group taxonomy
*/
class Tests_Taxonomy_IsTaxonomyViewable extends WP_UnitTestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
register_post_type( 'wptests_pt' );
register_taxonomy( 'wptests_tax_viewable', 'wptests_pt', array( 'publicly_queryable' => true ) );
diff --git a/tests/phpunit/tests/template.php b/tests/phpunit/tests/template.php
index 981a72b4f5..c807dc469b 100644
--- a/tests/phpunit/tests/template.php
+++ b/tests/phpunit/tests/template.php
@@ -63,8 +63,8 @@ class Tests_Template extends WP_UnitTestCase {
);
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
register_post_type(
'cpt',
array(
@@ -82,11 +82,11 @@ class Tests_Template extends WP_UnitTestCase {
$this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
}
- public function tearDown() {
+ public function tear_down() {
unregister_post_type( 'cpt' );
unregister_taxonomy( 'taxo' );
$this->set_permalink_structure( '' );
- parent::tearDown();
+ parent::tear_down();
}
diff --git a/tests/phpunit/tests/term/cache.php b/tests/phpunit/tests/term/cache.php
index 19e011ff99..8c8b85b75e 100644
--- a/tests/phpunit/tests/term/cache.php
+++ b/tests/phpunit/tests/term/cache.php
@@ -4,8 +4,8 @@
* @group taxonomy
*/
class Tests_Term_Cache extends WP_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
wp_cache_delete( 'last_changed', 'terms' );
}
diff --git a/tests/phpunit/tests/term/getEditTermLink.php b/tests/phpunit/tests/term/getEditTermLink.php
index 887b55bf86..8d52cf3f88 100644
--- a/tests/phpunit/tests/term/getEditTermLink.php
+++ b/tests/phpunit/tests/term/getEditTermLink.php
@@ -4,8 +4,8 @@
* @group taxonomy
*/
class Tests_Term_GetEditTermLink extends WP_UnitTestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) );
register_taxonomy( 'wptests_tax', 'post' );
}
diff --git a/tests/phpunit/tests/term/getTerm.php b/tests/phpunit/tests/term/getTerm.php
index 2b32500345..39e661bbe8 100644
--- a/tests/phpunit/tests/term/getTerm.php
+++ b/tests/phpunit/tests/term/getTerm.php
@@ -4,8 +4,8 @@
* @group taxonomy
*/
class Tests_Term_GetTerm extends WP_UnitTestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
register_taxonomy( 'wptests_tax', 'post' );
}
diff --git a/tests/phpunit/tests/term/getTermField.php b/tests/phpunit/tests/term/getTermField.php
index a8c8a7f72a..9761d87662 100644
--- a/tests/phpunit/tests/term/getTermField.php
+++ b/tests/phpunit/tests/term/getTermField.php
@@ -7,8 +7,8 @@ class Tests_Term_getTermField extends WP_UnitTestCase {
public $taxonomy = 'wptests_tax';
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
register_taxonomy( $this->taxonomy, 'post' );
}
diff --git a/tests/phpunit/tests/term/getTermLink.php b/tests/phpunit/tests/term/getTermLink.php
index 74c6d19dc3..c5b9fbbe32 100644
--- a/tests/phpunit/tests/term/getTermLink.php
+++ b/tests/phpunit/tests/term/getTermLink.php
@@ -5,8 +5,8 @@
*/
class Tests_Term_GetTermLink extends WP_UnitTestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
register_taxonomy( 'wptests_tax', 'post' );
}
diff --git a/tests/phpunit/tests/term/getTermParentsList.php b/tests/phpunit/tests/term/getTermParentsList.php
index 923571cfcb..753fc8fc90 100644
--- a/tests/phpunit/tests/term/getTermParentsList.php
+++ b/tests/phpunit/tests/term/getTermParentsList.php
@@ -24,8 +24,8 @@ class Tests_Terms_GetTermsParentsList extends WP_UnitTestCase {
wp_delete_term( self::$c2->term_id, 'wptests_tax' );
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
register_taxonomy( 'wptests_tax', 'post', array( 'hierarchical' => true ) );
}
diff --git a/tests/phpunit/tests/term/getTerms.php b/tests/phpunit/tests/term/getTerms.php
index ea16c6429b..af5b518d33 100644
--- a/tests/phpunit/tests/term/getTerms.php
+++ b/tests/phpunit/tests/term/getTerms.php
@@ -4,8 +4,8 @@
* @group taxonomy
*/
class Tests_Term_getTerms extends WP_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
_clean_term_filters();
wp_cache_delete( 'last_changed', 'terms' );
diff --git a/tests/phpunit/tests/term/meta.php b/tests/phpunit/tests/term/meta.php
index 9d3350eab0..976889fd8b 100644
--- a/tests/phpunit/tests/term/meta.php
+++ b/tests/phpunit/tests/term/meta.php
@@ -13,8 +13,8 @@ class Tests_Term_Meta extends WP_UnitTestCase {
'args' => array(),
);
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
register_taxonomy( 'wptests_tax', 'post' );
}
diff --git a/tests/phpunit/tests/term/slashes.php b/tests/phpunit/tests/term/slashes.php
index fa1ef30c20..9cfa83bdb9 100644
--- a/tests/phpunit/tests/term/slashes.php
+++ b/tests/phpunit/tests/term/slashes.php
@@ -12,8 +12,8 @@ class Tests_Term_Slashes extends WP_Ajax_UnitTestCase {
self::$author_id = $factory->user->create( array( 'role' => 'administrator' ) );
}
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
wp_set_current_user( self::$author_id );
diff --git a/tests/phpunit/tests/term/splitSharedTerm.php b/tests/phpunit/tests/term/splitSharedTerm.php
index 71acca0c77..65cefe8c4a 100644
--- a/tests/phpunit/tests/term/splitSharedTerm.php
+++ b/tests/phpunit/tests/term/splitSharedTerm.php
@@ -19,10 +19,10 @@ class Tests_Term_SplitSharedTerm extends WP_UnitTestCase {
* 'wptests_tax_2' taxonomy. This term is a child of t2, and is used to test parent/child relationships
* after term splitting.
*/
- public function setUp() {
+ public function set_up() {
global $wpdb;
- parent::setUp();
+ parent::set_up();
register_taxonomy( 'wptests_tax', 'post' );
register_taxonomy(
diff --git a/tests/phpunit/tests/term/taxQuery.php b/tests/phpunit/tests/term/taxQuery.php
index 677ad15e3b..78f88a58bb 100644
--- a/tests/phpunit/tests/term/taxQuery.php
+++ b/tests/phpunit/tests/term/taxQuery.php
@@ -6,8 +6,8 @@
class Tests_Term_Tax_Query extends WP_UnitTestCase {
protected $q;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
unset( $this->q );
$this->q = new WP_Query();
}
diff --git a/tests/phpunit/tests/term/termCounts.php b/tests/phpunit/tests/term/termCounts.php
index 9b4919ec71..fee7da3a4f 100644
--- a/tests/phpunit/tests/term/termCounts.php
+++ b/tests/phpunit/tests/term/termCounts.php
@@ -62,8 +62,8 @@ class Tests_Term_termCount extends WP_UnitTestCase {
self::$tag_ids = $factory->term->create_many( 5 );
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
self::register_taxonomies();
}
diff --git a/tests/phpunit/tests/term/wpGetObjectTerms.php b/tests/phpunit/tests/term/wpGetObjectTerms.php
index bc85e6e3ba..d7c0d51e11 100644
--- a/tests/phpunit/tests/term/wpGetObjectTerms.php
+++ b/tests/phpunit/tests/term/wpGetObjectTerms.php
@@ -7,8 +7,8 @@
class Tests_Term_WpGetObjectTerms extends WP_UnitTestCase {
private $taxonomy = 'wptests_tax';
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
register_taxonomy( 'wptests_tax', 'post' );
}
diff --git a/tests/phpunit/tests/term/wpInsertTerm.php b/tests/phpunit/tests/term/wpInsertTerm.php
index 9d7f32c5af..a2839d3c45 100644
--- a/tests/phpunit/tests/term/wpInsertTerm.php
+++ b/tests/phpunit/tests/term/wpInsertTerm.php
@@ -4,8 +4,8 @@
* @group taxonomy
*/
class Tests_Term_WpInsertTerm extends WP_UnitTestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
_clean_term_filters();
// Insert one term into every post taxonomy.
diff --git a/tests/phpunit/tests/term/wpTerm.php b/tests/phpunit/tests/term/wpTerm.php
index 9c6a832cb7..e640cf8120 100644
--- a/tests/phpunit/tests/term/wpTerm.php
+++ b/tests/phpunit/tests/term/wpTerm.php
@@ -6,8 +6,8 @@
class Tests_Term_WpTerm extends WP_UnitTestCase {
protected static $term_id;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
register_taxonomy( 'wptests_tax', 'post' );
}
diff --git a/tests/phpunit/tests/term/wpUniqueTermSlug.php b/tests/phpunit/tests/term/wpUniqueTermSlug.php
index c2efa334a1..835bd48182 100644
--- a/tests/phpunit/tests/term/wpUniqueTermSlug.php
+++ b/tests/phpunit/tests/term/wpUniqueTermSlug.php
@@ -4,8 +4,8 @@
* @group taxonomy
*/
class Tests_Term_WpUniqueTermSlug extends WP_UnitTestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
register_taxonomy( 'wptests_tax1', 'post', array( 'hierarchical' => false ) );
register_taxonomy( 'wptests_tax2', 'post', array( 'hierarchical' => true ) );
}
diff --git a/tests/phpunit/tests/theme.php b/tests/phpunit/tests/theme.php
index 24d44405cd..6e8ad62aee 100644
--- a/tests/phpunit/tests/theme.php
+++ b/tests/phpunit/tests/theme.php
@@ -22,10 +22,10 @@ class Tests_Theme extends WP_UnitTestCase {
'twentytwentyone',
);
- function setUp() {
+ function set_up() {
global $wp_theme_directories;
- parent::setUp();
+ parent::set_up();
$backup_wp_theme_directories = $wp_theme_directories;
$wp_theme_directories = array( WP_CONTENT_DIR . '/themes' );
@@ -35,7 +35,7 @@ class Tests_Theme extends WP_UnitTestCase {
unset( $GLOBALS['wp_themes'] );
}
- function tearDown() {
+ function tear_down() {
global $wp_theme_directories;
$wp_theme_directories = $this->wp_theme_directories;
@@ -44,7 +44,7 @@ class Tests_Theme extends WP_UnitTestCase {
wp_clean_themes_cache();
unset( $GLOBALS['wp_themes'] );
- parent::tearDown();
+ parent::tear_down();
}
function test_wp_get_themes_default() {
diff --git a/tests/phpunit/tests/theme/customHeader.php b/tests/phpunit/tests/theme/customHeader.php
index 07496b9d0d..ac9a493a7c 100644
--- a/tests/phpunit/tests/theme/customHeader.php
+++ b/tests/phpunit/tests/theme/customHeader.php
@@ -19,8 +19,8 @@ class Tests_Theme_CustomHeader extends WP_UnitTestCase {
self::$header_video_id = $factory->attachment->create_upload_object( $file );
}
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
$GLOBALS['wp_customize'] = new WP_Customize_Manager();
@@ -29,7 +29,7 @@ class Tests_Theme_CustomHeader extends WP_UnitTestCase {
wp_dequeue_script( 'wp-custom-header' );
}
- function tearDown() {
+ function tear_down() {
$this->customize_manager = null;
unset( $GLOBALS['wp_customize'] );
@@ -39,7 +39,7 @@ class Tests_Theme_CustomHeader extends WP_UnitTestCase {
remove_theme_mod( 'header_video' );
remove_theme_mod( 'external_header_video' );
- parent::tearDown();
+ parent::tear_down();
}
function test_add_and_remove_theme_support() {
diff --git a/tests/phpunit/tests/theme/themeDir.php b/tests/phpunit/tests/theme/themeDir.php
index 5455c66c9e..977bb226c4 100644
--- a/tests/phpunit/tests/theme/themeDir.php
+++ b/tests/phpunit/tests/theme/themeDir.php
@@ -7,8 +7,8 @@
*/
class Tests_Theme_ThemeDir extends WP_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->theme_root = DIR_TESTDATA . '/themedir1';
$this->orig_theme_dir = $GLOBALS['wp_theme_directories'];
@@ -24,11 +24,11 @@ class Tests_Theme_ThemeDir extends WP_UnitTestCase {
unset( $GLOBALS['wp_themes'] );
}
- function tearDown() {
+ function tear_down() {
$GLOBALS['wp_theme_directories'] = $this->orig_theme_dir;
wp_clean_themes_cache();
unset( $GLOBALS['wp_themes'] );
- parent::tearDown();
+ parent::tear_down();
}
// Replace the normal theme root directory with our premade test directory.
diff --git a/tests/phpunit/tests/theme/wpTheme.php b/tests/phpunit/tests/theme/wpTheme.php
index d9bb98726c..a85bcc89aa 100644
--- a/tests/phpunit/tests/theme/wpTheme.php
+++ b/tests/phpunit/tests/theme/wpTheme.php
@@ -10,8 +10,8 @@
*/
class Tests_Theme_wpTheme extends WP_UnitTestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->theme_root = realpath( DIR_TESTDATA . '/themedir1' );
$this->orig_theme_dir = $GLOBALS['wp_theme_directories'];
@@ -25,11 +25,11 @@ class Tests_Theme_wpTheme extends WP_UnitTestCase {
unset( $GLOBALS['wp_themes'] );
}
- public function tearDown() {
+ public function tear_down() {
$GLOBALS['wp_theme_directories'] = $this->orig_theme_dir;
wp_clean_themes_cache();
unset( $GLOBALS['wp_themes'] );
- parent::tearDown();
+ parent::tear_down();
}
// Replace the normal theme root directory with our premade test directory.
diff --git a/tests/phpunit/tests/theme/wpThemeJsonResolver.php b/tests/phpunit/tests/theme/wpThemeJsonResolver.php
index 41dffe9faa..081cb26234 100644
--- a/tests/phpunit/tests/theme/wpThemeJsonResolver.php
+++ b/tests/phpunit/tests/theme/wpThemeJsonResolver.php
@@ -12,8 +12,8 @@
*/
class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase {
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->theme_root = realpath( DIR_TESTDATA . '/themedir1' );
$this->orig_theme_dir = $GLOBALS['wp_theme_directories'];
@@ -29,11 +29,11 @@ class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase {
unset( $GLOBALS['wp_themes'] );
}
- public function tearDown() {
+ public function tear_down() {
$GLOBALS['wp_theme_directories'] = $this->orig_theme_dir;
wp_clean_themes_cache();
unset( $GLOBALS['wp_themes'] );
- parent::tearDown();
+ parent::tear_down();
}
public function filter_set_theme_root() {
diff --git a/tests/phpunit/tests/upload.php b/tests/phpunit/tests/upload.php
index 4c8b73a8a1..360a0ac1f7 100644
--- a/tests/phpunit/tests/upload.php
+++ b/tests/phpunit/tests/upload.php
@@ -7,8 +7,8 @@ class Tests_Upload extends WP_UnitTestCase {
public $siteurl;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->_reset_options();
}
diff --git a/tests/phpunit/tests/url.php b/tests/phpunit/tests/url.php
index 8da76b3939..dc37f7a5a2 100644
--- a/tests/phpunit/tests/url.php
+++ b/tests/phpunit/tests/url.php
@@ -7,8 +7,8 @@
*/
class Tests_URL extends WP_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$GLOBALS['pagenow'] = '';
}
diff --git a/tests/phpunit/tests/user.php b/tests/phpunit/tests/user.php
index 8deccda474..5f94848e05 100644
--- a/tests/phpunit/tests/user.php
+++ b/tests/phpunit/tests/user.php
@@ -60,8 +60,8 @@ class Tests_User extends WP_UnitTestCase {
self::$_author = get_user_by( 'ID', self::$author_id );
}
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->author = clone self::$_author;
}
diff --git a/tests/phpunit/tests/user/author.php b/tests/phpunit/tests/user/author.php
index fc562be93e..1dd92a486d 100644
--- a/tests/phpunit/tests/user/author.php
+++ b/tests/phpunit/tests/user/author.php
@@ -33,8 +33,8 @@ class Tests_User_Author_Template extends WP_UnitTestCase {
);
}
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
setup_postdata( get_post( self::$post_id ) );
}
diff --git a/tests/phpunit/tests/user/capabilities.php b/tests/phpunit/tests/user/capabilities.php
index f52b3f7dbe..ea74facc83 100644
--- a/tests/phpunit/tests/user/capabilities.php
+++ b/tests/phpunit/tests/user/capabilities.php
@@ -53,8 +53,8 @@ class Tests_User_Capabilities extends WP_UnitTestCase {
);
}
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
// Keep track of users we create.
$this->_flush_roles();
diff --git a/tests/phpunit/tests/user/countUserPosts.php b/tests/phpunit/tests/user/countUserPosts.php
index 0e18f938aa..a4244e2814 100644
--- a/tests/phpunit/tests/user/countUserPosts.php
+++ b/tests/phpunit/tests/user/countUserPosts.php
@@ -53,8 +53,8 @@ class Tests_User_CountUserPosts extends WP_UnitTestCase {
);
}
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
register_post_type( 'wptests_pt' );
}
diff --git a/tests/phpunit/tests/user/multisite.php b/tests/phpunit/tests/user/multisite.php
index 7a20cb16a9..0b2b1d380a 100644
--- a/tests/phpunit/tests/user/multisite.php
+++ b/tests/phpunit/tests/user/multisite.php
@@ -12,16 +12,16 @@ if ( is_multisite() ) :
class Tests_Multisite_User extends WP_UnitTestCase {
protected $suppress = false;
- function setUp() {
+ function set_up() {
global $wpdb;
- parent::setUp();
+ parent::set_up();
$this->suppress = $wpdb->suppress_errors();
}
- function tearDown() {
+ function tear_down() {
global $wpdb;
$wpdb->suppress_errors( $this->suppress );
- parent::tearDown();
+ parent::tear_down();
}
function test_remove_user_from_blog() {
diff --git a/tests/phpunit/tests/user/session.php b/tests/phpunit/tests/user/session.php
index a49e83f650..96cabe9c5e 100644
--- a/tests/phpunit/tests/user/session.php
+++ b/tests/phpunit/tests/user/session.php
@@ -7,8 +7,8 @@
*/
class Tests_User_Session extends WP_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
remove_all_filters( 'session_token_manager' );
$user_id = self::factory()->user->create();
$this->manager = WP_Session_Tokens::get_instance( $user_id );
diff --git a/tests/phpunit/tests/user/slashes.php b/tests/phpunit/tests/user/slashes.php
index d5d0fe20b8..c9f694600a 100644
--- a/tests/phpunit/tests/user/slashes.php
+++ b/tests/phpunit/tests/user/slashes.php
@@ -14,8 +14,8 @@ class Tests_User_Slashes extends WP_UnitTestCase {
self::$user_id = $factory->user->create();
}
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
wp_set_current_user( self::$author_id );
diff --git a/tests/phpunit/tests/user/wpSendUserRequest.php b/tests/phpunit/tests/user/wpSendUserRequest.php
index a6b86af18d..cb0c41fe69 100644
--- a/tests/phpunit/tests/user/wpSendUserRequest.php
+++ b/tests/phpunit/tests/user/wpSendUserRequest.php
@@ -63,8 +63,8 @@ class Tests_User_WpSendUserRequest extends WP_UnitTestCase {
*
* @since 4.9.9
*/
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
set_current_screen( 'dashboard' );
reset_phpmailer_instance();
@@ -75,13 +75,13 @@ class Tests_User_WpSendUserRequest extends WP_UnitTestCase {
*
* @since 4.9.9
*/
- public function tearDown() {
+ public function tear_down() {
reset_phpmailer_instance();
unset( $GLOBALS['locale'] );
restore_previous_locale();
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/walker.php b/tests/phpunit/tests/walker.php
index ea3ce16757..9745afe8cb 100644
--- a/tests/phpunit/tests/walker.php
+++ b/tests/phpunit/tests/walker.php
@@ -8,8 +8,8 @@
*/
class Tests_Walker extends WP_UnitTestCase {
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->walker = new Walker_Test();
}
diff --git a/tests/phpunit/tests/widgets.php b/tests/phpunit/tests/widgets.php
index e35c12f0e4..886039d687 100644
--- a/tests/phpunit/tests/widgets.php
+++ b/tests/phpunit/tests/widgets.php
@@ -21,12 +21,12 @@ class Tests_Widgets extends WP_UnitTestCase {
parent::clean_up_global_scope();
}
- function tearDown() {
+ function tear_down() {
global $wp_customize;
$wp_customize = null;
- parent::tearDown();
+ parent::tear_down();
}
/**
diff --git a/tests/phpunit/tests/wp.php b/tests/phpunit/tests/wp.php
index 428263298f..4fbb182a50 100644
--- a/tests/phpunit/tests/wp.php
+++ b/tests/phpunit/tests/wp.php
@@ -9,8 +9,8 @@ class Tests_WP extends WP_UnitTestCase {
*/
protected $wp;
- public function setUp() {
- parent::setUp();
+ public function set_up() {
+ parent::set_up();
$this->wp = new WP();
}
diff --git a/tests/phpunit/tests/xmlrpc/wp/getMediaItem.php b/tests/phpunit/tests/xmlrpc/wp/getMediaItem.php
index 41dd0300dc..bd7aff9554 100644
--- a/tests/phpunit/tests/xmlrpc/wp/getMediaItem.php
+++ b/tests/phpunit/tests/xmlrpc/wp/getMediaItem.php
@@ -14,8 +14,8 @@ class Tests_XMLRPC_wp_getMediaItem extends WP_XMLRPC_UnitTestCase {
self::$post_id = $factory->post->create();
}
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
add_theme_support( 'post-thumbnails' );
@@ -29,12 +29,12 @@ class Tests_XMLRPC_wp_getMediaItem extends WP_XMLRPC_UnitTestCase {
set_post_thumbnail( self::$post_id, $this->attachment_id );
}
- function tearDown() {
+ function tear_down() {
remove_theme_support( 'post-thumbnails' );
$this->remove_added_uploads();
- parent::tearDown();
+ parent::tear_down();
}
function test_invalid_username_password() {
diff --git a/tests/phpunit/tests/xmlrpc/wp/getPost.php b/tests/phpunit/tests/xmlrpc/wp/getPost.php
index b0bc92cd58..4b47d17778 100644
--- a/tests/phpunit/tests/xmlrpc/wp/getPost.php
+++ b/tests/phpunit/tests/xmlrpc/wp/getPost.php
@@ -9,8 +9,8 @@ class Tests_XMLRPC_wp_getPost extends WP_XMLRPC_UnitTestCase {
public $post_date_ts;
public $post_custom_field;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->post_date_ts = strtotime( '+1 day' );
$this->post_data = array(
diff --git a/tests/phpunit/tests/xmlrpc/wp/getPostType.php b/tests/phpunit/tests/xmlrpc/wp/getPostType.php
index 3d77a48d3e..9823917af4 100644
--- a/tests/phpunit/tests/xmlrpc/wp/getPostType.php
+++ b/tests/phpunit/tests/xmlrpc/wp/getPostType.php
@@ -7,8 +7,8 @@ class Tests_XMLRPC_wp_getPostType extends WP_XMLRPC_UnitTestCase {
public $cpt_name;
public $cpt_args;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->cpt_name = 'post_type_test';
$this->cpt_args = array(
diff --git a/tests/phpunit/tests/xmlrpc/wp/getUser.php b/tests/phpunit/tests/xmlrpc/wp/getUser.php
index 65ae5c1a96..c1e1016c09 100644
--- a/tests/phpunit/tests/xmlrpc/wp/getUser.php
+++ b/tests/phpunit/tests/xmlrpc/wp/getUser.php
@@ -7,8 +7,8 @@
class Tests_XMLRPC_wp_getUser extends WP_XMLRPC_UnitTestCase {
protected $administrator_id;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
// Create a super admin.
$this->administrator_id = $this->make_user_by_role( 'administrator' );
diff --git a/tests/phpunit/tests/xmlrpc/wp/restoreRevision.php b/tests/phpunit/tests/xmlrpc/wp/restoreRevision.php
index e89e1f988c..75a9b85b8a 100644
--- a/tests/phpunit/tests/xmlrpc/wp/restoreRevision.php
+++ b/tests/phpunit/tests/xmlrpc/wp/restoreRevision.php
@@ -7,8 +7,8 @@ class Tests_XMLRPC_wp_restoreRevision extends WP_XMLRPC_UnitTestCase {
public $post_id;
public $revision_id;
- function setUp() {
- parent::setUp();
+ function set_up() {
+ parent::set_up();
$this->post_id = self::factory()->post->create( array( 'post_content' => 'edit1' ) ); // Not saved as a revision.
// First saved revision on update, see https://core.trac.wordpress.org/changeset/24650
diff --git a/tests/phpunit/tests/xmlrpc/wp/uploadFile.php b/tests/phpunit/tests/xmlrpc/wp/uploadFile.php
index 5098735bad..7d60f8f1f8 100644
--- a/tests/phpunit/tests/xmlrpc/wp/uploadFile.php
+++ b/tests/phpunit/tests/xmlrpc/wp/uploadFile.php
@@ -6,10 +6,10 @@
*/
class Tests_XMLRPC_wp_uploadFile extends WP_XMLRPC_UnitTestCase {
- public function tearDown() {
+ public function tear_down() {
$this->remove_added_uploads();
- parent::tearDown();
+ parent::tear_down();
}
function test_valid_attachment() {