mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-16 23:00:21 +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:
@@ -19,7 +19,7 @@ class Tests_Widgets_wpWidgetMediaAudio extends WP_UnitTestCase {
|
||||
* @global WP_Scripts $wp_scripts
|
||||
* @global WP_Styles $wp_styles
|
||||
*/
|
||||
function clean_up_global_scope() {
|
||||
public function clean_up_global_scope() {
|
||||
global $wp_scripts, $wp_styles;
|
||||
parent::clean_up_global_scope();
|
||||
$wp_scripts = null;
|
||||
@@ -31,7 +31,7 @@ class Tests_Widgets_wpWidgetMediaAudio extends WP_UnitTestCase {
|
||||
*
|
||||
* @covers WP_Widget_Media_Audio::get_instance_schema
|
||||
*/
|
||||
function test_get_instance_schema() {
|
||||
public function test_get_instance_schema() {
|
||||
$wp_widget_audio = new WP_Widget_Media_Audio();
|
||||
$schema = $wp_widget_audio->get_instance_schema();
|
||||
|
||||
@@ -57,7 +57,7 @@ class Tests_Widgets_wpWidgetMediaAudio extends WP_UnitTestCase {
|
||||
*
|
||||
* @ticket 45029
|
||||
*/
|
||||
function test_get_instance_schema_filtering() {
|
||||
public function test_get_instance_schema_filtering() {
|
||||
$wp_widget_audio = new WP_Widget_Media_Audio();
|
||||
$schema = $wp_widget_audio->get_instance_schema();
|
||||
|
||||
@@ -87,7 +87,7 @@ class Tests_Widgets_wpWidgetMediaAudio extends WP_UnitTestCase {
|
||||
*
|
||||
* @covers WP_Widget_Media_Audio::__construct
|
||||
*/
|
||||
function test_constructor() {
|
||||
public function test_constructor() {
|
||||
$widget = new WP_Widget_Media_Audio();
|
||||
|
||||
$this->assertArrayHasKey( 'mime_type', $widget->widget_options );
|
||||
@@ -116,7 +116,7 @@ class Tests_Widgets_wpWidgetMediaAudio extends WP_UnitTestCase {
|
||||
*
|
||||
* @covers WP_Widget_Media_Audio::update
|
||||
*/
|
||||
function test_update() {
|
||||
public function test_update() {
|
||||
$widget = new WP_Widget_Media_Audio();
|
||||
$instance = array();
|
||||
|
||||
@@ -216,7 +216,7 @@ class Tests_Widgets_wpWidgetMediaAudio extends WP_UnitTestCase {
|
||||
*
|
||||
* @covers WP_Widget_Media_Audio::render_media
|
||||
*/
|
||||
function test_render_media() {
|
||||
public function test_render_media() {
|
||||
$test_audio_file = __FILE__ . '../../data/uploads/small-audio.mp3';
|
||||
$widget = new WP_Widget_Media_Audio();
|
||||
$attachment_id = self::factory()->attachment->create_object(
|
||||
@@ -282,7 +282,7 @@ class Tests_Widgets_wpWidgetMediaAudio extends WP_UnitTestCase {
|
||||
* @global WP_Styles $wp_styles
|
||||
* @covers WP_Widget_Media_Audio::enqueue_preview_scripts
|
||||
*/
|
||||
function test_enqueue_preview_scripts() {
|
||||
public function test_enqueue_preview_scripts() {
|
||||
global $wp_scripts, $wp_styles;
|
||||
$wp_scripts = null;
|
||||
$wp_styles = null;
|
||||
@@ -302,7 +302,7 @@ class Tests_Widgets_wpWidgetMediaAudio extends WP_UnitTestCase {
|
||||
*
|
||||
* @covers WP_Widget_Media_Audio::enqueue_admin_scripts
|
||||
*/
|
||||
function test_enqueue_admin_scripts() {
|
||||
public function test_enqueue_admin_scripts() {
|
||||
set_current_screen( 'widgets.php' );
|
||||
$widget = new WP_Widget_Media_Audio();
|
||||
$widget->enqueue_admin_scripts();
|
||||
@@ -315,7 +315,7 @@ class Tests_Widgets_wpWidgetMediaAudio extends WP_UnitTestCase {
|
||||
*
|
||||
* @covers WP_Widget_Media_Audio::render_control_template_scripts
|
||||
*/
|
||||
function test_render_control_template_scripts() {
|
||||
public function test_render_control_template_scripts() {
|
||||
$widget = new WP_Widget_Media_Audio();
|
||||
|
||||
ob_start();
|
||||
|
||||
Reference in New Issue
Block a user