Make WordPress Core


Ignore:
Timestamp:
06/30/2021 06:21:52 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Add missing visibility keywords to WP_Theme, WP_Theme_JSON, and WP_Theme_JSON_Resolver tests.

Follow-up to [50959], [50960], [50967].

See #52627.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/theme/wpTheme.php

    r50967 r51287  
    1010 */
    1111class Tests_Theme_wpTheme extends WP_UnitTestCase {
    12     function setUp() {
     12
     13    public function setUp() {
    1314        parent::setUp();
    1415        $this->theme_root = realpath( DIR_TESTDATA . '/themedir1' );
     
    2526    }
    2627
    27     function tearDown() {
     28    public function tearDown() {
    2829        $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir;
    2930        wp_clean_themes_cache();
     
    3334
    3435    // Replace the normal theme root directory with our premade test directory.
    35     function _theme_root( $dir ) {
     36    public function _theme_root( $dir ) {
    3637        return $this->theme_root;
    3738    }
    38     function test_new_WP_Theme_top_level() {
     39
     40    public function test_new_WP_Theme_top_level() {
    3941        $theme = new WP_Theme( 'theme1', $this->theme_root );
    4042
     
    5557    }
    5658
    57     function test_new_WP_Theme_subdir() {
     59    public function test_new_WP_Theme_subdir() {
    5860        $theme = new WP_Theme( 'subdir/theme2', $this->theme_root );
    5961
     
    7779     * @ticket 20313
    7880     */
    79     function test_new_WP_Theme_subdir_bad_root() {
     81    public function test_new_WP_Theme_subdir_bad_root() {
    8082        // This is what get_theme_data() does when you pass it a style.css file for a theme in a subdirectory.
    8183        $theme = new WP_Theme( 'theme2', $this->theme_root . '/subdir' );
     
    100102     * @ticket 21749
    101103     */
    102     function test_wp_theme_uris_with_spaces() {
     104    public function test_wp_theme_uris_with_spaces() {
    103105        $theme = new WP_Theme( 'theme with spaces', $this->theme_root . '/subdir' );
    104106        // Make sure subdir/ is considered part of the stylesheet, as we must avoid encoding /'s.
     
    117119     * @ticket 21969
    118120     */
    119     function test_theme_uris_with_spaces() {
     121    public function test_theme_uris_with_spaces() {
    120122        $callback = array( $this, 'filter_theme_with_spaces' );
    121123        add_filter( 'stylesheet', $callback );
     
    129131    }
    130132
    131     function filter_theme_with_spaces() {
     133    public function filter_theme_with_spaces() {
    132134        return 'subdir/theme with spaces';
    133135    }
     
    136138     * @ticket 26873
    137139     */
    138     function test_display_method_on_get_method_failure() {
     140    public function test_display_method_on_get_method_failure() {
    139141        $theme = new WP_Theme( 'nonexistent', $this->theme_root );
    140142        $this->assertSame( 'nonexistent', $theme->get( 'Name' ) );
     
    147149     * @ticket 40820
    148150     */
    149     function test_child_theme_with_itself_as_parent_should_appear_as_broken() {
     151    public function test_child_theme_with_itself_as_parent_should_appear_as_broken() {
    150152        $theme  = new WP_Theme( 'child-parent-itself', $this->theme_root );
    151153        $errors = $theme->errors();
     
    161163     * @group ms-required
    162164     */
    163     function test_wp_theme_network_enable_single_theme() {
     165    public function test_wp_theme_network_enable_single_theme() {
    164166        $theme                  = 'testtheme-1';
    165167        $current_allowed_themes = get_site_option( 'allowedthemes' );
     
    178180     * @group ms-required
    179181     */
    180     function test_wp_theme_network_enable_multiple_themes() {
     182    public function test_wp_theme_network_enable_multiple_themes() {
    181183        $themes                 = array( 'testtheme-2', 'testtheme-3' );
    182184        $current_allowed_themes = get_site_option( 'allowedthemes' );
     
    201203     * @group ms-required
    202204     */
    203     function test_network_disable_single_theme() {
     205    public function test_network_disable_single_theme() {
    204206        $current_allowed_themes = get_site_option( 'allowedthemes' );
    205207
     
    226228     * @group ms-required
    227229     */
    228     function test_network_disable_multiple_themes() {
     230    public function test_network_disable_multiple_themes() {
    229231        $current_allowed_themes = get_site_option( 'allowedthemes' );
    230232
Note: See TracChangeset for help on using the changeset viewer.