Changeset 51331 for trunk/tests/phpunit/tests/post/objects.php
- Timestamp:
- 07/05/2021 05:21:53 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/objects.php
r50935 r51331 31 31 // Excercise the output argument. 32 32 $post = get_post( $id, ARRAY_A ); 33 $this->assertI nternalType( 'array',$post );33 $this->assertIsArray( $post ); 34 34 $this->assertSame( 'post', $post['post_type'] ); 35 35 36 36 $post = get_post( $id, ARRAY_N ); 37 $this->assertI nternalType( 'array',$post );37 $this->assertIsArray( $post ); 38 38 $this->assertFalse( isset( $post['post_type'] ) ); 39 39 $this->assertTrue( in_array( 'post', $post, true ) ); … … 41 41 $post = get_post( $id ); 42 42 $post = get_post( $post, ARRAY_A ); 43 $this->assertI nternalType( 'array',$post );43 $this->assertIsArray( $post ); 44 44 $this->assertSame( 'post', $post['post_type'] ); 45 45 $this->assertSame( $id, $post['ID'] ); … … 52 52 // Make sure stdClass in $GLOBALS['post'] is handled. 53 53 $post_std = $post->to_array(); 54 $this->assertI nternalType( 'array',$post_std );54 $this->assertIsArray( $post_std ); 55 55 $post_std = (object) $post_std; 56 56 $GLOBALS['post'] = $post_std; … … 104 104 function test_get_post_ancestors_with_falsey_values() { 105 105 foreach ( array( null, 0, false, '0', '' ) as $post_id ) { 106 $this->assertI nternalType( 'array',get_post_ancestors( $post_id ) );106 $this->assertIsArray( get_post_ancestors( $post_id ) ); 107 107 $this->assertSame( array(), get_post_ancestors( $post_id ) ); 108 108 } … … 113 113 $post = get_post( $post_id ); 114 114 115 $this->assertI nternalType( 'array',$post->post_category );115 $this->assertIsArray( $post->post_category ); 116 116 $this->assertSame( 1, count( $post->post_category ) ); 117 117 $this->assertEquals( get_option( 'default_category' ), $post->post_category[0] ); … … 132 132 $post = get_post( $post_id ); 133 133 134 $this->assertI nternalType( 'array',$post->tags_input );134 $this->assertIsArray( $post->tags_input ); 135 135 $this->assertEmpty( $post->tags_input ); 136 136 wp_set_post_tags( $post_id, 'Foo, Bar, Baz' ); 137 $this->assertI nternalType( 'array',$post->tags_input );137 $this->assertIsArray( $post->tags_input ); 138 138 $this->assertSame( 3, count( $post->tags_input ) ); 139 139 $this->assertSame( array( 'Bar', 'Baz', 'Foo' ), $post->tags_input ); 140 140 141 141 $post = get_post( $post_id, ARRAY_A ); 142 $this->assertI nternalType( 'array',$post['tags_input'] );142 $this->assertIsArray( $post['tags_input'] ); 143 143 $this->assertSame( 3, count( $post['tags_input'] ) ); 144 144 $this->assertSame( array( 'Bar', 'Baz', 'Foo' ), $post['tags_input'] ); … … 149 149 $post = get_post( $post_id ); 150 150 151 $this->assertI nternalType( 'string',$post->page_template );151 $this->assertIsString( $post->page_template ); 152 152 $template = get_post_meta( $post->ID, '_wp_page_template', true ); 153 153 $this->assertSame( $template, $post->page_template ); … … 168 168 169 169 $this->assertSame( 'raw', $post->filter ); 170 $this->assertI nternalType( 'int',$post->post_parent );170 $this->assertIsInt( $post->post_parent ); 171 171 172 172 $display_post = get_post( $post, OBJECT, 'js' ); … … 195 195 $post = get_post( $post_id, OBJECT, $context ); 196 196 197 $this->assertI nternalType( 'int',$post->ID );198 $this->assertI nternalType( 'int',$post->post_parent );199 $this->assertI nternalType( 'int',$post->menu_order );197 $this->assertIsInt( $post->ID ); 198 $this->assertIsInt( $post->post_parent ); 199 $this->assertIsInt( $post->menu_order ); 200 200 } 201 201 } … … 216 216 217 217 $this->assertSame( $id, $post['ID'] ); 218 $this->assertI nternalType( 'array',$post['ancestors'] );218 $this->assertIsArray( $post['ancestors'] ); 219 219 $this->assertSame( 'raw', $post['filter'] ); 220 220 }
Note: See TracChangeset
for help on using the changeset viewer.