mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +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_wpWidgetMediaImage 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_wpWidgetMediaImage extends WP_UnitTestCase {
|
||||
*
|
||||
* @covers WP_Widget_Media_Image::get_instance_schema
|
||||
*/
|
||||
function test_get_instance_schema() {
|
||||
public function test_get_instance_schema() {
|
||||
$widget = new WP_Widget_Media_Image();
|
||||
$schema = $widget->get_instance_schema();
|
||||
|
||||
@@ -64,7 +64,7 @@ class Tests_Widgets_wpWidgetMediaImage extends WP_UnitTestCase {
|
||||
*
|
||||
* @ticket 45029
|
||||
*/
|
||||
function test_get_instance_schema_filtering() {
|
||||
public function test_get_instance_schema_filtering() {
|
||||
$widget = new WP_Widget_Media_Image();
|
||||
$schema = $widget->get_instance_schema();
|
||||
|
||||
@@ -94,7 +94,7 @@ class Tests_Widgets_wpWidgetMediaImage extends WP_UnitTestCase {
|
||||
*
|
||||
* @covers WP_Widget_Media_Image::__construct
|
||||
*/
|
||||
function test_constructor() {
|
||||
public function test_constructor() {
|
||||
$widget = new WP_Widget_Media_Image();
|
||||
|
||||
$this->assertArrayHasKey( 'mime_type', $widget->widget_options );
|
||||
@@ -123,7 +123,7 @@ class Tests_Widgets_wpWidgetMediaImage extends WP_UnitTestCase {
|
||||
*
|
||||
* @covers WP_Widget_Media_Image::update
|
||||
*/
|
||||
function test_update() {
|
||||
public function test_update() {
|
||||
$widget = new WP_Widget_Media_Image();
|
||||
$instance = array();
|
||||
|
||||
@@ -410,7 +410,7 @@ class Tests_Widgets_wpWidgetMediaImage extends WP_UnitTestCase {
|
||||
* @covers WP_Widget_Media_Image::render_media
|
||||
* @requires function imagejpeg
|
||||
*/
|
||||
function test_render_media() {
|
||||
public function test_render_media() {
|
||||
$widget = new WP_Widget_Media_Image();
|
||||
|
||||
$test_image = get_temp_dir() . 'canola.jpg';
|
||||
@@ -608,7 +608,7 @@ class Tests_Widgets_wpWidgetMediaImage extends WP_UnitTestCase {
|
||||
*
|
||||
* @covers WP_Widget_Media_Image::enqueue_admin_scripts
|
||||
*/
|
||||
function test_enqueue_admin_scripts() {
|
||||
public function test_enqueue_admin_scripts() {
|
||||
set_current_screen( 'widgets.php' );
|
||||
$widget = new WP_Widget_Media_Image();
|
||||
$widget->enqueue_admin_scripts();
|
||||
@@ -621,7 +621,7 @@ class Tests_Widgets_wpWidgetMediaImage extends WP_UnitTestCase {
|
||||
*
|
||||
* @covers WP_Widget_Media_Image::render_control_template_scripts
|
||||
*/
|
||||
function test_render_control_template_scripts() {
|
||||
public function test_render_control_template_scripts() {
|
||||
$widget = new WP_Widget_Media_Image();
|
||||
|
||||
ob_start();
|
||||
|
||||
Reference in New Issue
Block a user