Make WordPress Core

Changeset 1020 in tests for trunk/tests/post/types.php


Ignore:
Timestamp:
09/13/2012 04:56:24 PM (12 years ago)
Author:
nacin
Message:

Tests for #WP21586.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/post/types.php

    r909 r1020  
    1616        $this->assertFalse( is_post_type_hierarchical( 'foo' ) );
    1717        $this->assertEquals( array(), get_object_taxonomies( 'foo' ) );
     18
     19        _unregister_post_type( 'foo' );
    1820    }
    1921
     
    3638        $this->assertFalse( is_object_in_taxonomy( 'bar', 'post_tag' ) );
    3739        $this->assertFalse( is_object_in_taxonomy( 'bar', 'post_tag' ) );
     40
     41        _unregister_post_type( 'bar' );
    3842    }
    3943
     
    5054        $this->assertFalse( post_type_supports( 'notaposttype', 'notafeature' ) );
    5155    }
     56
     57    /**
     58     * @ticket 21586
     59     */
     60    function test_post_type_with_no_support() {
     61        register_post_type( 'foo', array( 'supports' => array() ) );
     62        $this->assertTrue( post_type_supports( 'foo', 'editor' ) );
     63        $this->assertTrue( post_type_supports( 'foo', 'title' ) );
     64        _unregister_post_type( 'foo' );
     65
     66        register_post_type( 'foo', array( 'supports' => false ) );
     67        $this->assertFalse( post_type_supports( 'foo', 'editor' ) );
     68        $this->assertFalse( post_type_supports( 'foo', 'title' ) );
     69        _unregister_post_type( 'foo' );
     70    }
    5271}
Note: See TracChangeset for help on using the changeset viewer.