Make WordPress Core

Ticket #23302: 23302.test.patch

File 23302.test.patch, 739 bytes (added by johnpbloch, 12 years ago)

Unit test

  • tests/post/types.php

     
    6868                $this->assertFalse( post_type_supports( 'foo', 'title' ) );
    6969                _unregister_post_type( 'foo' );
    7070        }
     71
     72        function test_post_type_with_no_feed() {
     73                global $wp_rewrite;
     74                $old_permastruct = get_option( 'permalink_structure' );
     75                update_option( 'permalink_structure', '%postname%' );
     76                register_post_type( 'foo', array( 'rewrite' => array( 'feeds' => false ) ) );
     77                $this->assertFalse( $wp_rewrite->extra_permastructs['foo']['feed'] );
     78                update_option( 'permalink_structure', $old_permastruct );
     79                _unregister_post_type( 'foo' );
     80        }
    7181}