Make WordPress Core


Ignore:
Timestamp:
09/04/2013 05:43:29 PM (12 years ago)
Author:
nacin
Message:

add_theme_support( 'html5' ) now defaults to comment-list, comment-form, and search-form.

This was the implicit case in 3.6.0, modified in [25193].

see #24932.

File:
1 edited

Legend:

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

    r25193 r25235  
    8686        $this->assertFalse( current_theme_supports( 'html5' ) );
    8787        $this->assertFalse( current_theme_supports( 'html5', 'comment-form' ) );
    88         $this->assertFalse( add_theme_support( 'html5' ) );
    89         $this->assertFalse( current_theme_supports( 'html5' ) );
    90         $this->assertFalse( current_theme_supports( 'html5', 'comment-form' ) );
     88        $this->assertNotSame( false, add_theme_support( 'html5' ) );
     89        $this->assertTrue( current_theme_supports( 'html5' ) );
     90        $this->assertTrue( current_theme_supports( 'html5', 'comment-form' ) );
     91        $this->assertTrue( current_theme_supports( 'html5', 'comment-list' ) );
     92        $this->assertTrue( current_theme_supports( 'html5', 'search-form' ) );
     93        $this->assertFalse( current_theme_supports( 'html5', 'something-else' ) );
    9194    }
    9295
     
    107110
    108111        // It appends, rather than replaces.
    109         $this->assertFalse( current_theme_supports( 'html5', 'comments-list' ) );
    110         $this->assertNotSame( false, add_theme_support( 'html5', array( 'comments-list' ) ) );
     112        $this->assertFalse( current_theme_supports( 'html5', 'comment-list' ) );
     113        $this->assertNotSame( false, add_theme_support( 'html5', array( 'comment-list' ) ) );
    111114        $this->assertTrue( current_theme_supports( 'html5', 'comment-form' ) );
    112         $this->assertTrue( current_theme_supports( 'html5', 'comments-list' ) );
     115        $this->assertTrue( current_theme_supports( 'html5', 'comment-list' ) );
    113116        $this->assertFalse( current_theme_supports( 'html5', 'search-form' ) );
    114117
    115118        // Removal is all or nothing.
    116119        $this->assertTrue( remove_theme_support( 'html5' ) );
    117         $this->assertFalse( current_theme_supports( 'html5', 'comments-list' ) );
    118         $this->assertFalse( current_theme_supports( 'html5', 'comments-form' ) );
     120        $this->assertFalse( current_theme_supports( 'html5', 'comment-list' ) );
     121        $this->assertFalse( current_theme_supports( 'html5', 'comment-form' ) );
    119122        $this->assertFalse( current_theme_supports( 'html5', 'search-form' ) );
     123    }
     124
     125    /**
     126     * @ticket 24932
     127     */
     128    function test_supports_html5_invalid() {
     129        remove_theme_support( 'html5' );
     130        $this->assertFalse( add_theme_support( 'html5', 'comment-form' ) );
     131        $this->assertFalse( current_theme_supports( 'html5', 'comment-form' ) );
     132        $this->assertFalse( current_theme_supports( 'html5' ) );
    120133    }
    121134
Note: See TracChangeset for help on using the changeset viewer.