mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +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:
@@ -33,7 +33,7 @@ class Block_Template_Utils_Test extends WP_UnitTestCase {
|
||||
wp_delete_post( self::$post->ID );
|
||||
}
|
||||
|
||||
function test_build_template_result_from_post() {
|
||||
public function test_build_template_result_from_post() {
|
||||
$template = _build_template_result_from_post(
|
||||
self::$post,
|
||||
'wp_template'
|
||||
@@ -53,7 +53,7 @@ class Block_Template_Utils_Test extends WP_UnitTestCase {
|
||||
/**
|
||||
* Should retrieve the template from the CPT.
|
||||
*/
|
||||
function test_get_block_template_from_post() {
|
||||
public function test_get_block_template_from_post() {
|
||||
$id = get_stylesheet() . '//' . 'my_template';
|
||||
$template = get_block_template( $id, 'wp_template' );
|
||||
$this->assertSame( $id, $template->id );
|
||||
@@ -67,7 +67,7 @@ class Block_Template_Utils_Test extends WP_UnitTestCase {
|
||||
/**
|
||||
* Should retrieve block templates.
|
||||
*/
|
||||
function test_get_block_templates() {
|
||||
public function test_get_block_templates() {
|
||||
function get_template_ids( $templates ) {
|
||||
return array_map(
|
||||
static function( $template ) {
|
||||
|
||||
Reference in New Issue
Block a user