Make WordPress Core

Changeset 814 in tests


Ignore:
Timestamp:
06/30/2012 09:07:53 PM (12 years ago)
Author:
nacin
Message:

Fix TestThemeSupport tests. see #92.

We can't say for sure what the current theme's support is. So add/remove/add to make sure we can test both.

Add some grouping. see #56, #92, #72.

Location:
trunk/wp-testcase
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-testcase/test_admin_includes_theme.php

    r780 r814  
    11<?php
    2 // Test functions that fetch stuff from the theme directory
     2/**
     3 * @group themes
     4 */
    35class TestPageTemplates extends WP_UnitTestCase {
    46    function setUp() {
  • trunk/wp-testcase/test_includes_class-wp-theme.php

    r778 r814  
    11<?php
     2/**
     3 * @group themes
     4 */
    25class Test_WP_Theme extends WP_UnitTestCase {
    36    function setUp() {
  • trunk/wp-testcase/test_includes_theme.php

    r779 r814  
    11<?php
    22
    3 // test wp-includes/theme.php
     3/**
     4 * test wp-includes/theme.php
     5 *
     6 * @group themes
     7 */
    48class TestDefaultThemes extends WP_UnitTestCase {
    59
     
    236240}
    237241
    238 // Test functions that fetch stuff from the theme directory
     242/**
     243 * Test functions that fetch stuff from the theme directory
     244 *
     245 * @group themes
     246 */
    239247class TestThemeDir extends WP_UnitTestCase {
    240248    function setUp() {
     
    431439}
    432440
     441/**
     442 * @group themes
     443 */
    433444class TestLargeThemeDir extends WP_UnitTestCase {
    434445    function setUp() {
     
    492503}
    493504
     505/**
     506 * @group themes
     507 */
    494508class TestThemeSupport extends WP_UnitTestCase {
    495509    function setUp() {
     
    502516
    503517    function test_the_basics() {
    504         $this->assertFalse( current_theme_supports( 'automatic-feed-links' ) );
    505518        add_theme_support( 'automatic-feed-links' );
    506519        $this->assertTrue( current_theme_supports( 'automatic-feed-links' ) );
    507520        remove_theme_support( 'automatic-feed-links' );
    508521        $this->assertFalse( current_theme_supports( 'automatic-feed-links' ) );
     522        add_theme_support( 'automatic-feed-links' );
     523        $this->assertTrue( current_theme_supports( 'automatic-feed-links' ) );
    509524    }
    510525
    511526    function test_admin_bar() {
    512         $this->assertFalse( current_theme_supports( 'admin-bar' ) );
    513527        add_theme_support( 'admin-bar' );
    514528        $this->assertTrue( current_theme_supports( 'admin-bar' ) );
    515529        remove_theme_support( 'admin-bar' );
    516530        $this->assertFalse( current_theme_supports( 'admin-bar' ) );
     531        add_theme_support( 'admin-bar' );
     532        $this->assertTrue( current_theme_supports( 'admin-bar' ) );
    517533
    518534        add_theme_support( 'admin-bar', array( 'callback' => '__return_false' ) );
     
    529545
    530546    function test_post_thumbnails() {
    531         $this->assertFalse( current_theme_supports( 'post-thumbnails' ) );
    532547        add_theme_support( 'post-thumbnails' );
    533548        $this->assertTrue( current_theme_supports( 'post-thumbnails' ) );
    534549        remove_theme_support( 'post-thumbnails' );
    535550        $this->assertFalse( current_theme_supports( 'post-thumbnails' ) );
     551        add_theme_support( 'post-thumbnails' );
     552        $this->assertTrue( current_theme_supports( 'post-thumbnails' ) );
    536553
    537554        // simple array of post types.
Note: See TracChangeset for help on using the changeset viewer.