Make WordPress Core

Ticket #19257: 19257-tests.patch

File 19257-tests.patch, 1.6 KB (added by mordauk, 9 years ago)
  • tests/phpunit/tests/post/types.php

     
    101101                update_option( 'permalink_structure', $old_permastruct );
    102102                _unregister_post_type( 'foo' );
    103103        }
     104
     105        /**
     106         * @ticket 19257
     107         */
     108        function test_post_type_featured_image_labels() {
     109               
     110                register_post_type( 'foo' );
     111
     112                $post_type_object = get_post_type_object( 'foo' );
     113
     114                $this->assertEquals( 'Featured Image', $post_type_object->labels->featured_image );
     115                $this->assertEquals( 'Set featured image', $post_type_object->labels->set_featured_image );
     116                $this->assertEquals( 'Use as featured image', $post_type_object->labels->use_featured_image );
     117                $this->assertEquals( 'Remove featured image', $post_type_object->labels->remove_featured_image );
     118
     119                _unregister_post_type( 'foo' );
     120
     121                register_post_type( 'foo', array( 'labels' => array(
     122                        'featured_image' => 'Cover Image',
     123                        'set_featured_image' => 'Set cover image',
     124                        'remove_featured_image' => 'Remove cover image',
     125                        'use_featured_image' => 'Use as cover image'
     126                ) ) );
     127
     128                $post_type_object = get_post_type_object( 'foo' );
     129
     130                $this->assertEquals( 'Cover Image', $post_type_object->labels->featured_image );
     131                $this->assertEquals( 'Set cover image', $post_type_object->labels->set_featured_image );
     132                $this->assertEquals( 'Use as cover image', $post_type_object->labels->use_featured_image );
     133                $this->assertEquals( 'Remove cover image', $post_type_object->labels->remove_featured_image );
     134
     135        }
    104136}