From d050f5d3ffa3b5186f824c242b1314b32ea4971c Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 1 Dec 2013 00:42:39 +0000 Subject: [PATCH] Use assertEqualSets() instead of direct array comparison. fixes #26345 git-svn-id: https://develop.svn.wordpress.org/trunk@26490 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/post/query.php | 40 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/phpunit/tests/post/query.php b/tests/phpunit/tests/post/query.php index 829a01c01a..2e31f4d24e 100644 --- a/tests/phpunit/tests/post/query.php +++ b/tests/phpunit/tests/post/query.php @@ -223,7 +223,7 @@ class Tests_Post_Query extends WP_UnitTestCase { ) ), ) ); - $this->assertEquals( array( $post_3 ), wp_list_pluck( $query->posts, 'ID' ) ); + $this->assertEqualSets( array( $post_3 ), wp_list_pluck( $query->posts, 'ID' ) ); $query = new WP_Query( array( 'meta_query' => array( @@ -235,7 +235,7 @@ class Tests_Post_Query extends WP_UnitTestCase { ) ), ) ); - $this->assertEquals( array( $post_4 ), wp_list_pluck( $query->posts, 'ID' ) ); + $this->assertEqualSets( array( $post_4 ), wp_list_pluck( $query->posts, 'ID' ) ); $query = new WP_Query( array( 'meta_query' => array( @@ -247,7 +247,7 @@ class Tests_Post_Query extends WP_UnitTestCase { ) ), ) ); - $this->assertEquals( array( $post_3, $post_4 ), wp_list_pluck( $query->posts, 'ID' ) ); + $this->assertEqualSets( array( $post_3, $post_4 ), wp_list_pluck( $query->posts, 'ID' ) ); $query = new WP_Query( array( 'meta_query' => array( @@ -259,7 +259,7 @@ class Tests_Post_Query extends WP_UnitTestCase { ) ), ) ); - $this->assertEquals( array( $post_1 ), wp_list_pluck( $query->posts, 'ID' ) ); + $this->assertEqualSets( array( $post_1 ), wp_list_pluck( $query->posts, 'ID' ) ); $query = new WP_Query( array( 'meta_query' => array( @@ -272,7 +272,7 @@ class Tests_Post_Query extends WP_UnitTestCase { ), ) ); - $this->assertEquals( array( $post_1, $post_2, $post_3 ), wp_list_pluck( $query->posts, 'ID' ) ); + $this->assertEqualSets( array( $post_1, $post_2, $post_3 ), wp_list_pluck( $query->posts, 'ID' ) ); $query = new WP_Query( array( 'meta_query' => array( @@ -284,7 +284,7 @@ class Tests_Post_Query extends WP_UnitTestCase { ) ), ) ); - $this->assertEquals( array( $post_3 ), wp_list_pluck( $query->posts, 'ID' ) ); + $this->assertEqualSets( array( $post_3 ), wp_list_pluck( $query->posts, 'ID' ) ); $query = new WP_Query( array( 'meta_query' => array( @@ -296,7 +296,7 @@ class Tests_Post_Query extends WP_UnitTestCase { ) ), ) ); - $this->assertEquals( array( $post_1, $post_2, $post_4 ), wp_list_pluck( $query->posts, 'ID' ) ); + $this->assertEqualSets( array( $post_1, $post_2, $post_4 ), wp_list_pluck( $query->posts, 'ID' ) ); $query = new WP_Query( array( 'meta_query' => array( @@ -308,19 +308,19 @@ class Tests_Post_Query extends WP_UnitTestCase { ) ), ) ); - $this->assertEquals( array( $post_1, $post_3 ), wp_list_pluck( $query->posts, 'ID' ) ); + $this->assertEqualSets( array( $post_1, $post_3 ), wp_list_pluck( $query->posts, 'ID' ) ); - $query = new WP_Query( array( - 'meta_query' => array( - array( - 'key' => 'decimal_value', - 'value' => '.3', - 'compare' => 'NOT LIKE', - 'type' => 'DECIMAL(10,2)' - ) - ), - ) ); - $this->assertEquals( array( $post_2, $post_4 ), wp_list_pluck( $query->posts, 'ID' ) ); + $query = new WP_Query( array( + 'meta_query' => array( + array( + 'key' => 'decimal_value', + 'value' => '.3', + 'compare' => 'NOT LIKE', + 'type' => 'DECIMAL(10,2)' + ) + ), + ) ); + $this->assertEqualSets( array( $post_2, $post_4 ), wp_list_pluck( $query->posts, 'ID' ) ); $query = new WP_Query( array( 'orderby' => 'meta_value', @@ -328,7 +328,7 @@ class Tests_Post_Query extends WP_UnitTestCase { 'meta_key' => 'decimal_value', 'meta_type' => 'DECIMAL(10, 2)' ) ); - $this->assertEquals( array( $post_4, $post_3, $post_2, $post_1 ), wp_list_pluck( $query->posts, 'ID' ) ); + $this->assertEqualSets( array( $post_4, $post_3, $post_2, $post_1 ), wp_list_pluck( $query->posts, 'ID' ) ); }