mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-09 07:04:34 +00:00
Coding Standards: Add visibility to methods in tests/phpunit/tests/.
Adds a `public` visibility to test fixtures, tests, data providers, and callbacks methods. Adds a `private` visibility to helper methods within test classes. Renames callbacks and helpers that previously started with a `_` prefix. Why? For consistency and to leverage using the method visibility. Further naming standardizations is beyond the scope of this commit. Props costdev, jrf, hellofromTonya. Fixes #54177. git-svn-id: https://develop.svn.wordpress.org/trunk@52010 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
class Tests_Basic extends WP_UnitTestCase {
|
||||
|
||||
function test_license() {
|
||||
public function test_license() {
|
||||
// This test is designed to only run on trunk/master.
|
||||
$this->skipOnAutomatedBranches();
|
||||
|
||||
@@ -17,7 +17,7 @@ class Tests_Basic extends WP_UnitTestCase {
|
||||
$this->assertSame( $this_year, trim( $matches[1] ), "license.txt's year needs to be updated to $this_year." );
|
||||
}
|
||||
|
||||
function test_security_md() {
|
||||
public function test_security_md() {
|
||||
// This test is designed to only run on trunk/master.
|
||||
$this->skipOnAutomatedBranches();
|
||||
|
||||
@@ -28,7 +28,7 @@ class Tests_Basic extends WP_UnitTestCase {
|
||||
$this->assertSame( $latest_stable, trim( $matches[0] ), "SECURITY.md's version needs to be updated to $latest_stable." );
|
||||
}
|
||||
|
||||
function test_package_json() {
|
||||
public function test_package_json() {
|
||||
$package_json = file_get_contents( dirname( ABSPATH ) . '/package.json' );
|
||||
$package_json = json_decode( $package_json, true );
|
||||
list( $version ) = explode( '-', $GLOBALS['wp_version'] );
|
||||
@@ -43,14 +43,14 @@ class Tests_Basic extends WP_UnitTestCase {
|
||||
/**
|
||||
* @depends test_package_json
|
||||
*/
|
||||
function test_package_json_node_engine( $package_json ) {
|
||||
public function test_package_json_node_engine( $package_json ) {
|
||||
$this->assertArrayHasKey( 'engines', $package_json );
|
||||
$this->assertArrayHasKey( 'node', $package_json['engines'] );
|
||||
}
|
||||
|
||||
// Test some helper utility functions.
|
||||
|
||||
function test_strip_ws() {
|
||||
public function test_strip_ws() {
|
||||
$this->assertSame( '', strip_ws( '' ) );
|
||||
$this->assertSame( 'foo', strip_ws( 'foo' ) );
|
||||
$this->assertSame( '', strip_ws( "\r\n\t \n\r\t" ) );
|
||||
@@ -77,7 +77,7 @@ class Tests_Basic extends WP_UnitTestCase {
|
||||
|
||||
}
|
||||
|
||||
function test_mask_input_value() {
|
||||
public function test_mask_input_value() {
|
||||
$in = <<<EOF
|
||||
<h2>Assign Authors</h2>
|
||||
<p>To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as <code>admin</code>s entries.</p>
|
||||
|
||||
Reference in New Issue
Block a user