Changeset 37481
- Timestamp:
- 05/22/2016 04:18:22 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r37479 r37481 4246 4246 return; 4247 4247 } else { 4248 return get_post( $cached );4248 return get_post( $cached, $output ); 4249 4249 } 4250 4250 } -
trunk/tests/phpunit/tests/post/getPageByPath.php
r37479 r37481 243 243 $this->assertSame( $num_queries, $wpdb->num_queries ); 244 244 } 245 246 /** 247 * @ticket 37611 248 */ 249 public function test_output_param_should_be_obeyed_for_cached_value() { 250 $page = self::factory()->post->create( array( 251 'post_type' => 'page', 252 'post_name' => 'foo', 253 ) ); 254 255 // Prime cache. 256 $found = get_page_by_path( 'foo' ); 257 $this->assertSame( $page, $found->ID ); 258 259 $object = get_page_by_path( 'foo', OBJECT ); 260 $this->assertInternalType( 'object', $object ); 261 $this->assertSame( $page, $object->ID ); 262 263 $array_n = get_page_by_path( 'foo', ARRAY_N ); 264 $this->assertInternalType( 'array', $array_n ); 265 $this->assertSame( $page, $array_n[0] ); 266 267 $array_a = get_page_by_path( 'foo', ARRAY_A ); 268 $this->assertInternalType( 'array', $array_a ); 269 $this->assertSame( $page, $array_a['ID'] ); 270 } 245 271 }
Note: See TracChangeset
for help on using the changeset viewer.