mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Props SergeyBiryukov, for the original patch. Fixes #26321. git-svn-id: https://develop.svn.wordpress.org/trunk@27166 602fd350-edb4-49c9-b593-d223f7449a82
31 lines
745 B
PHP
31 lines
745 B
PHP
<?php
|
|
/**
|
|
* @group post
|
|
* @group thumbnails
|
|
*/
|
|
class Tests_Post_Thumbnails extends WP_UnitTestCase {
|
|
/**
|
|
* @ticket 26321
|
|
*/
|
|
function test_update_post_thumbnail_cache() {
|
|
update_post_thumbnail_cache();
|
|
|
|
$this->assertFalse( $GLOBALS['wp_query']->thumbnails_cached );
|
|
|
|
$this->factory->post->create_many( 3 );
|
|
$GLOBALS['wp_query'] = new WP_Query( array( 'post_type' => 'post' ) );
|
|
|
|
update_post_thumbnail_cache();
|
|
|
|
$this->assertTrue( $GLOBALS['wp_query']->thumbnails_cached );
|
|
|
|
$q = new WP_Query();
|
|
update_post_thumbnail_cache( $q );
|
|
$this->assertFalse( $q->thumbnails_cached );
|
|
|
|
$p = new WP_Query( array( 'post_type' => 'post' ) );
|
|
update_post_thumbnail_cache( $p );
|
|
$this->assertTrue( $p->thumbnails_cached );
|
|
}
|
|
}
|