Changeset 30148
- Timestamp:
- 11/01/2014 04:00:59 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme/support.php
r29894 r30148 35 35 } 36 36 37 function test_post_thumbnails() {37 public function test_post_thumbnails() { 38 38 add_theme_support( 'post-thumbnails' ); 39 39 $this->assertTrue( current_theme_supports( 'post-thumbnails' ) ); … … 42 42 add_theme_support( 'post-thumbnails' ); 43 43 $this->assertTrue( current_theme_supports( 'post-thumbnails' ) ); 44 } 44 45 45 // simple array of post types.46 public function test_post_thumbnails_flat_array_of_post_types() { 46 47 add_theme_support( 'post-thumbnails', array( 'post', 'page' ) ); 47 48 $this->assertTrue( current_theme_supports( 'post-thumbnails' ) ); … … 50 51 remove_theme_support( 'post-thumbnails' ); 51 52 $this->assertFalse( current_theme_supports( 'post-thumbnails' ) ); 53 } 52 54 53 #WP18548 54 if ( ! function_exists( '_wp_render_title_tag' ) ) 55 return; 56 57 // array of arguments, with the key of 'types' holding the post types. 58 add_theme_support( 'post-thumbnails', array( 'types' => array( 'post', 'page' ) ) ); 59 $this->assertTrue( current_theme_supports( 'post-thumbnails' ) ); 60 $this->assertTrue( current_theme_supports( 'post-thumbnails', 'post' ) ); 61 $this->assertFalse( current_theme_supports( 'post-thumbnails', 'book' ) ); 62 remove_theme_support( 'post-thumbnails' ); 63 $this->assertFalse( current_theme_supports( 'post-thumbnails' ) ); 64 55 public function test_post_thumbnails_types_true() { 65 56 // array of arguments, with the key of 'types' holding the post types. 66 57 add_theme_support( 'post-thumbnails', array( 'types' => true ) ); … … 69 60 remove_theme_support( 'post-thumbnails' ); 70 61 $this->assertFalse( current_theme_supports( 'post-thumbnails' ) ); 71 72 // array of arguments, with some other argument, and no 'types' argument.73 add_theme_support( 'post-thumbnails', array( rand_str() => rand_str() ) );74 $this->assertTrue( current_theme_supports( 'post-thumbnails' ) );75 $this->assertTrue( current_theme_supports( 'post-thumbnails', rand_str() ) ); // any type76 remove_theme_support( 'post-thumbnails' );77 $this->assertFalse( current_theme_supports( 'post-thumbnails' ) );78 79 62 } 80 63
Note: See TracChangeset
for help on using the changeset viewer.