Make WordPress Core

Ticket #28135: 28135_test.diff

File 28135_test.diff, 541 bytes (added by tanner m, 11 years ago)

Here is a unit test for this issue. Hope it helps!

  • tests/phpunit/tests/post.php

     
    912912                _unregister_taxonomy( $tax );
    913913        }
    914914
     915        /**
     916         * @ticket 28135
     917         */
     918        function test_wp_insert_post_unregistered_post_type() {
     919                $post_id = wp_insert_post( array(
     920                        'post_type'  => 'unregistered',
     921                        'post_title' => 'Unregistered Post Type',
     922                ) );
     923
     924                $this->assertInstanceOf( 'WP_Error', $post_id );
     925        }
     926
    915927}