summaryrefslogtreecommitdiffstatshomepage
path: root/tests/phpunit/includes
diff options
context:
space:
mode:
authorSergey Biryukov <sergeybiryukov@git.wordpress.org>2020-10-17 16:24:35 +0000
committerSergey Biryukov <sergeybiryukov@git.wordpress.org>2020-10-17 16:24:35 +0000
commit5bad4e7f8d6cf67fbcea1e7c763cc41bceaa810b (patch)
tree1885d02dd312ea8be646dfc6d1d67873c69605f3 /tests/phpunit/includes
parent5b6a20af07f7a34b1e20611a58741e20454cbd1a (diff)
downloadwordpress-5bad4e7f8d6cf67fbcea1e7c763cc41bceaa810b.tar.gz
wordpress-5bad4e7f8d6cf67fbcea1e7c763cc41bceaa810b.zip
Code Modernization: Use explicit visibility for class property declarations.
Using `var` or only `static` to declare a class property is PHP 4 code. This updates the codebase to use explicit visibility modifiers introduced in PHP 5. Props jrf. Fixes #51557. See #22234. git-svn-id: https://develop.svn.wordpress.org/trunk@49184 602fd350-edb4-49c9-b593-d223f7449a82
Diffstat (limited to 'tests/phpunit/includes')
-rw-r--r--tests/phpunit/includes/factory/class-wp-unittest-generator-sequence.php2
-rw-r--r--tests/phpunit/includes/mock-mailer.php2
-rw-r--r--tests/phpunit/includes/testcase-canonical.php14
-rw-r--r--tests/phpunit/includes/utils.php8
4 files changed, 13 insertions, 13 deletions
diff --git a/tests/phpunit/includes/factory/class-wp-unittest-generator-sequence.php b/tests/phpunit/includes/factory/class-wp-unittest-generator-sequence.php
index 5c0778f3d4..9391dd8bf7 100644
--- a/tests/phpunit/includes/factory/class-wp-unittest-generator-sequence.php
+++ b/tests/phpunit/includes/factory/class-wp-unittest-generator-sequence.php
@@ -1,7 +1,7 @@
<?php
class WP_UnitTest_Generator_Sequence {
- static $incr = -1;
+ public static $incr = -1;
public $next;
public $template_string;
diff --git a/tests/phpunit/includes/mock-mailer.php b/tests/phpunit/includes/mock-mailer.php
index e5e3d98fa2..d02d2efc69 100644
--- a/tests/phpunit/includes/mock-mailer.php
+++ b/tests/phpunit/includes/mock-mailer.php
@@ -3,7 +3,7 @@ require_once ABSPATH . 'wp-includes/PHPMailer/PHPMailer.php';
require_once ABSPATH . 'wp-includes/PHPMailer/Exception.php';
class MockPHPMailer extends PHPMailer\PHPMailer\PHPMailer {
- var $mock_sent = array();
+ public $mock_sent = array();
function preSend() {
$this->Encoding = '8bit';
diff --git a/tests/phpunit/includes/testcase-canonical.php b/tests/phpunit/includes/testcase-canonical.php
index 655c0b0612..3866145589 100644
--- a/tests/phpunit/includes/testcase-canonical.php
+++ b/tests/phpunit/includes/testcase-canonical.php
@@ -1,13 +1,13 @@
<?php
class WP_Canonical_UnitTestCase extends WP_UnitTestCase {
- static $old_current_user;
- static $author_id;
- static $post_ids = array();
- static $comment_ids = array();
- static $term_ids = array();
- static $terms = array();
- static $old_options = array();
+ public static $old_current_user;
+ public static $author_id;
+ public static $post_ids = array();
+ public static $comment_ids = array();
+ public static $term_ids = array();
+ public static $terms = array();
+ public static $old_options = array();
/**
* This can be defined in a subclass of this class which contains its own data() method.
diff --git a/tests/phpunit/includes/utils.php b/tests/phpunit/includes/utils.php
index 08b7c0f5d9..1546d4e973 100644
--- a/tests/phpunit/includes/utils.php
+++ b/tests/phpunit/includes/utils.php
@@ -38,8 +38,8 @@ function strip_ws( $txt ) {
* add_action( 'foo', array( &$ma, 'action' ) );
*/
class MockAction {
- var $events;
- var $debug;
+ public $events;
+ public $debug;
/**
* PHP5 constructor.
@@ -184,8 +184,8 @@ class MockAction {
// Convert valid XML to an array tree structure.
// Kinda lame, but it works with a default PHP 4 installation.
class TestXMLParser {
- var $xml;
- var $data = array();
+ public $xml;
+ public $data = array();
/**
* PHP5 constructor.