Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/phpunit/includes/testcase-canonical.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public function set_up() {
update_option( 'posts_per_page', 5 );

$this->set_permalink_structure( $this->structure );
create_initial_taxonomies();
$this->reset_taxonomies();
flush_rewrite_rules();
}

/**
Expand Down
8 changes: 8 additions & 0 deletions tests/phpunit/tests/query/stickies.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
*/
class Tests_Query_Stickies extends WP_UnitTestCase {
public static $posts = array();
private static $original_sticky_posts;

public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
self::$original_sticky_posts = get_option( 'sticky_posts' );
update_option( 'sticky_posts', array() );

// Set post times to get a reliable order.
$now = time();
for ( $i = 0; $i <= 22; $i++ ) {
Expand All @@ -26,6 +30,10 @@ public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
stick_post( self::$posts[8] );
}

public static function wpTearDownAfterClass() {
update_option( 'sticky_posts', self::$original_sticky_posts );
}

public function test_stickies_should_be_ignored_when_is_home_is_false() {
$q = new WP_Query(
array(
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/query/thePost.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function ( $fields, $query ) {
'fields' => 'custom',
'post_type' => 'page',
'post__in' => self::$page_child_ids,
'orderby' => 'id',
'orderby' => 'ID',
'order' => 'ASC',
)
);
Expand Down
Loading