From e547ecc791efee1dcd60710687470cd95d7babe1 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 14 Jan 2019 04:54:01 +0000 Subject: [PATCH] Tests: Add missing `parent::setUp()` calls to all test classes. Props johnbillion, birgire. Fixes #37375. git-svn-id: https://develop.svn.wordpress.org/trunk@44577 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/admin/includesScreen.php | 1 + tests/phpunit/tests/filesystem/base.php | 1 + tests/phpunit/tests/formatting/redirect.php | 1 + tests/phpunit/tests/http/base.php | 1 + tests/phpunit/tests/image/editor.php | 2 +- tests/phpunit/tests/locale.php | 1 + tests/phpunit/tests/oembed/WpEmbed.php | 1 + tests/phpunit/tests/pomo/po.php | 1 + tests/phpunit/tests/rewrite/rewriteTags.php | 2 ++ tests/phpunit/tests/taxonomy/getObjectTaxonomies.php | 1 + tests/phpunit/tests/wp.php | 1 + 11 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/tests/admin/includesScreen.php b/tests/phpunit/tests/admin/includesScreen.php index 3d85ad8bb3..e576c60f44 100644 --- a/tests/phpunit/tests/admin/includesScreen.php +++ b/tests/phpunit/tests/admin/includesScreen.php @@ -126,6 +126,7 @@ class Tests_Admin_includesScreen extends WP_UnitTestCase { function setUp() { set_current_screen( 'front' ); + parent::setUp(); } function tearDown() { diff --git a/tests/phpunit/tests/filesystem/base.php b/tests/phpunit/tests/filesystem/base.php index 0e06546d31..356be3c9e0 100644 --- a/tests/phpunit/tests/filesystem/base.php +++ b/tests/phpunit/tests/filesystem/base.php @@ -5,6 +5,7 @@ */ abstract class WP_Filesystem_UnitTestCase extends WP_UnitTestCase { function setUp() { + parent::setUp(); add_filter( 'filesystem_method_file', array( $this, 'filter_abstraction_file' ) ); add_filter( 'filesystem_method', array( $this, 'filter_fs_method' ) ); WP_Filesystem(); diff --git a/tests/phpunit/tests/formatting/redirect.php b/tests/phpunit/tests/formatting/redirect.php index 3b1c582a0a..a29e8bb050 100644 --- a/tests/phpunit/tests/formatting/redirect.php +++ b/tests/phpunit/tests/formatting/redirect.php @@ -7,6 +7,7 @@ */ class Tests_Formatting_Redirect extends WP_UnitTestCase { function setUp() { + parent::setUp(); add_filter( 'home_url', array( $this, 'home_url' ) ); } diff --git a/tests/phpunit/tests/http/base.php b/tests/phpunit/tests/http/base.php index 011870f836..bed3cf4c89 100644 --- a/tests/phpunit/tests/http/base.php +++ b/tests/phpunit/tests/http/base.php @@ -39,6 +39,7 @@ abstract class WP_HTTP_UnitTestCase extends WP_UnitTestCase { } function setUp() { + parent::setUp(); if ( is_callable( array( 'WP_Http', '_getTransport' ) ) ) { $this->markTestSkipped( 'The WP_Http tests require a class-http.php file of r17550 or later.' ); diff --git a/tests/phpunit/tests/image/editor.php b/tests/phpunit/tests/image/editor.php index 2908340992..680070c728 100644 --- a/tests/phpunit/tests/image/editor.php +++ b/tests/phpunit/tests/image/editor.php @@ -14,7 +14,7 @@ class Tests_Image_Editor extends WP_Image_UnitTestCase { /** * Setup test fixture */ - public function setup() { + public function setUp() { require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' ); include_once( DIR_TESTDATA . '/../includes/mock-image-editor.php' ); diff --git a/tests/phpunit/tests/locale.php b/tests/phpunit/tests/locale.php index 98a700509c..4788d57d90 100644 --- a/tests/phpunit/tests/locale.php +++ b/tests/phpunit/tests/locale.php @@ -11,6 +11,7 @@ class Tests_Locale extends WP_UnitTestCase { protected $locale; public function setUp() { + parent::setUp(); $this->locale = new WP_Locale(); } diff --git a/tests/phpunit/tests/oembed/WpEmbed.php b/tests/phpunit/tests/oembed/WpEmbed.php index 3d1e652838..86f3c32d3a 100644 --- a/tests/phpunit/tests/oembed/WpEmbed.php +++ b/tests/phpunit/tests/oembed/WpEmbed.php @@ -10,6 +10,7 @@ class Tests_WP_Embed extends WP_UnitTestCase { protected $wp_embed; public function setUp() { + parent::setUp(); $this->wp_embed = new WP_Embed(); } diff --git a/tests/phpunit/tests/pomo/po.php b/tests/phpunit/tests/pomo/po.php index d1b7b0a880..4f5bef31fa 100644 --- a/tests/phpunit/tests/pomo/po.php +++ b/tests/phpunit/tests/pomo/po.php @@ -5,6 +5,7 @@ */ class Tests_POMO_PO extends WP_UnitTestCase { function setUp() { + parent::setUp(); 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/rewrite/rewriteTags.php b/tests/phpunit/tests/rewrite/rewriteTags.php index d8cde6929b..a636b9fd63 100644 --- a/tests/phpunit/tests/rewrite/rewriteTags.php +++ b/tests/phpunit/tests/rewrite/rewriteTags.php @@ -11,6 +11,8 @@ class Tests_Rewrite_Tags extends WP_UnitTestCase { public function setUp() { global $wp_rewrite; + parent::setUp(); + $this->wp_rewrite = $wp_rewrite; $wp_rewrite = new WP_Rewrite(); $wp_rewrite->init(); diff --git a/tests/phpunit/tests/taxonomy/getObjectTaxonomies.php b/tests/phpunit/tests/taxonomy/getObjectTaxonomies.php index 0a13a81e3a..f57e910ed4 100644 --- a/tests/phpunit/tests/taxonomy/getObjectTaxonomies.php +++ b/tests/phpunit/tests/taxonomy/getObjectTaxonomies.php @@ -5,6 +5,7 @@ */ class Tests_Taxonomy_GetObjectTaxonomies extends WP_UnitTestCase { public function setUp() { + parent::setUp(); register_post_type( 'wptests_pt' ); register_taxonomy( 'wptests_tax', 'wptests_pt' ); } diff --git a/tests/phpunit/tests/wp.php b/tests/phpunit/tests/wp.php index df5cdfcf37..218c087c05 100644 --- a/tests/phpunit/tests/wp.php +++ b/tests/phpunit/tests/wp.php @@ -10,6 +10,7 @@ class Tests_WP extends WP_UnitTestCase { protected $wp; public function setUp() { + parent::setUp(); $this->wp = new WP(); }