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
This commit is contained in:
Boone Gorges 2015-01-20 21:59:24 +00:00
parent 70eee8514b
commit 5fdc8a8364
1 changed files with 0 additions and 53 deletions

View File

@ -1,53 +0,0 @@
<?php
/**
* @ticket 22435
*/
class Test_WP_Post_IDs_Iterator extends WP_UnitTestCase {
function setUp() {
if ( ! class_exists( 'WP_Post_IDs_Iterator' ) ) {
$this->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' ) );
}
}