Make WordPress Core


Ignore:
Timestamp:
11/04/2021 03:22:47 PM (3 years ago)
Author:
hellofromTonya
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/widgets/wpWidgetMediaAudio.php

    r51493 r52010  
    2020     * @global WP_Styles $wp_styles
    2121     */
    22     function clean_up_global_scope() {
     22    public function clean_up_global_scope() {
    2323        global $wp_scripts, $wp_styles;
    2424        parent::clean_up_global_scope();
     
    3232     * @covers WP_Widget_Media_Audio::get_instance_schema
    3333     */
    34     function test_get_instance_schema() {
     34    public function test_get_instance_schema() {
    3535        $wp_widget_audio = new WP_Widget_Media_Audio();
    3636        $schema          = $wp_widget_audio->get_instance_schema();
     
    5858     * @ticket 45029
    5959     */
    60     function test_get_instance_schema_filtering() {
     60    public function test_get_instance_schema_filtering() {
    6161        $wp_widget_audio = new WP_Widget_Media_Audio();
    6262        $schema          = $wp_widget_audio->get_instance_schema();
     
    8888     * @covers WP_Widget_Media_Audio::__construct
    8989     */
    90     function test_constructor() {
     90    public function test_constructor() {
    9191        $widget = new WP_Widget_Media_Audio();
    9292
     
    117117     * @covers WP_Widget_Media_Audio::update
    118118     */
    119     function test_update() {
     119    public function test_update() {
    120120        $widget   = new WP_Widget_Media_Audio();
    121121        $instance = array();
     
    217217     * @covers WP_Widget_Media_Audio::render_media
    218218     */
    219     function test_render_media() {
     219    public function test_render_media() {
    220220        $test_audio_file = __FILE__ . '../../data/uploads/small-audio.mp3';
    221221        $widget          = new WP_Widget_Media_Audio();
     
    283283     * @covers WP_Widget_Media_Audio::enqueue_preview_scripts
    284284     */
    285     function test_enqueue_preview_scripts() {
     285    public function test_enqueue_preview_scripts() {
    286286        global $wp_scripts, $wp_styles;
    287287        $wp_scripts = null;
     
    303303     * @covers WP_Widget_Media_Audio::enqueue_admin_scripts
    304304     */
    305     function test_enqueue_admin_scripts() {
     305    public function test_enqueue_admin_scripts() {
    306306        set_current_screen( 'widgets.php' );
    307307        $widget = new WP_Widget_Media_Audio();
     
    316316     * @covers WP_Widget_Media_Audio::render_control_template_scripts
    317317     */
    318     function test_render_control_template_scripts() {
     318    public function test_render_control_template_scripts() {
    319319        $widget = new WP_Widget_Media_Audio();
    320320
Note: See TracChangeset for help on using the changeset viewer.