WordPress.org

Make WordPress Core

Ticket #30013: 30013-unit-test.diff

File 30013-unit-test.diff, 575 bytes (added by Kloon, 7 years ago)

Unit test get_post_type_object function with non scalar values

  • tests/phpunit/tests/post/types.php

     
    8181                update_option( 'permalink_structure', $old_permastruct );
    8282                _unregister_post_type( 'foo' );
    8383        }
     84
     85        /**
     86         * @ticket 30013
     87         */
     88        function test_get_post_type_object_with_non_scalar_values() {
     89        $this->assertFalse( get_post_type_object( array() ) );
     90        $this->assertFalse( get_post_type_object( new stdClass ) );
     91    }
     92
    8493}