From 5fdc8a836473e9dd79637b373fb185f5db3f0a3f Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Tue, 20 Jan 2015 21:59:24 +0000 Subject: [PATCH] Remove `WP_Post_IDs_Iterator` tests. The tests have been moved to a patch on the ticket where the class has been proposed, #22435. See #30284. git-svn-id: https://develop.svn.wordpress.org/trunk@31254 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/iterators.php | 53 ------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 tests/phpunit/tests/iterators.php diff --git a/tests/phpunit/tests/iterators.php b/tests/phpunit/tests/iterators.php deleted file mode 100644 index bd5f0d70b3..0000000000 --- a/tests/phpunit/tests/iterators.php +++ /dev/null @@ -1,53 +0,0 @@ -markTestSkipped( "WP_Post_IDs_Iterator class doesn't exist" ); - } - - parent::setUp(); - } - - function test_create() { - new WP_Post_IDs_Iterator( array( 1, 2, 3 ) ); - } - - function test_no_posts() { - $this->assertIteratorReturnsSamePostIDs( array() ); - } - - function test_less_ids_than_limit() { - $post_id_0 = $this->factory->post->create(); - $post_id_1 = $this->factory->post->create(); - $this->assertIteratorReturnsSamePostIDs( array( $post_id_0, $post_id_1 ), 10 ); - } - - function test_ids_exactly_as_limit() { - $post_id_0 = $this->factory->post->create(); - $post_id_1 = $this->factory->post->create(); - $this->assertIteratorReturnsSamePostIDs( array( $post_id_0, $post_id_1 ), 2 ); - } - - function test_more_ids_than_limit() { - $post_id_0 = $this->factory->post->create(); - $post_id_1 = $this->factory->post->create(); - $post_id_2 = $this->factory->post->create(); - $this->assertIteratorReturnsSamePostIDs( array( $post_id_0, $post_id_1, $post_id_2 ), 2 ); - } - - function test_ids_exactly_twice_more_than_limit() { - $post_id_0 = $this->factory->post->create(); - $post_id_1 = $this->factory->post->create(); - $post_id_2 = $this->factory->post->create(); - $post_id_3 = $this->factory->post->create(); - $this->assertIteratorReturnsSamePostIDs( array( $post_id_0, $post_id_1, $post_id_2, $post_id_3 ), 2 ); - } - - private function assertIteratorReturnsSamePostIDs( $post_ids, $limit = 2 ) { - $this->assertEquals( $post_ids, wp_list_pluck( iterator_to_array( new WP_Post_IDs_Iterator( $post_ids, $limit ) ), 'ID' ) ); - } -}