mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 14:47:02 +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:
@@ -15,7 +15,7 @@ class Tests_Comment_Slashes extends WP_UnitTestCase {
|
||||
self::$post_id = $factory->post->create();
|
||||
}
|
||||
|
||||
function set_up() {
|
||||
public function set_up() {
|
||||
parent::set_up();
|
||||
|
||||
wp_set_current_user( self::$author_id );
|
||||
@@ -34,7 +34,7 @@ class Tests_Comment_Slashes extends WP_UnitTestCase {
|
||||
/**
|
||||
* Tests the extended model function that expects slashed data.
|
||||
*/
|
||||
function test_wp_new_comment() {
|
||||
public function test_wp_new_comment() {
|
||||
$post_id = self::$post_id;
|
||||
|
||||
// Not testing comment_author_email or comment_author_url
|
||||
@@ -73,7 +73,7 @@ class Tests_Comment_Slashes extends WP_UnitTestCase {
|
||||
/**
|
||||
* Tests the controller function that expects slashed data.
|
||||
*/
|
||||
function test_edit_comment() {
|
||||
public function test_edit_comment() {
|
||||
$post_id = self::$post_id;
|
||||
$comment_id = self::factory()->comment->create(
|
||||
array(
|
||||
@@ -119,7 +119,7 @@ class Tests_Comment_Slashes extends WP_UnitTestCase {
|
||||
/**
|
||||
* Tests the model function that expects slashed data.
|
||||
*/
|
||||
function test_wp_insert_comment() {
|
||||
public function test_wp_insert_comment() {
|
||||
$post_id = self::$post_id;
|
||||
|
||||
$comment_id = wp_insert_comment(
|
||||
@@ -150,7 +150,7 @@ class Tests_Comment_Slashes extends WP_UnitTestCase {
|
||||
/**
|
||||
* Tests the model function that expects slashed data.
|
||||
*/
|
||||
function test_wp_update_comment() {
|
||||
public function test_wp_update_comment() {
|
||||
$post_id = self::$post_id;
|
||||
$comment_id = self::factory()->comment->create(
|
||||
array(
|
||||
|
||||
Reference in New Issue
Block a user