function test_exclude_ids()
 {
     $howmany = 20;
     $post_ids = $this->factory->post->create_many($howmany);
     shuffle($post_ids);
     $working_ids = array_slice($post_ids, 5);
     $qq = new QQuery();
     $posts1 = $qq->all()->go();
     $posts2 = $qq->all()->exclude($working_ids)->go();
     $this->assertNotEquals($posts1, $posts2);
 }
 function test_get_by_type()
 {
     $test_type_0 = 'test_type_0';
     $test_type_1 = 'test_type_1';
     $test_type_2 = 'test_type_2';
     add_action('init', 'create_post_types');
     function create_post_type()
     {
         register_post_type($test_type_0);
         register_post_type($test_type_1);
         register_post_type($test_type_2);
     }
     $num_type_1 = 11;
     $this->factory->post->create_many($num_type_1, array('post_type' => $test_type_1));
     $num_type_2 = 12;
     $this->factory->post->create_many($num_type_2, array('post_type' => $test_type_2));
     // seeding additional records
     $this->factory->post->create_many(5);
     $qq = new QQuery();
     $all_posts = $qq->all()->go();
     $type_0_posts = $qq->type($test_type_0)->all()->go();
     $type_1_posts = $qq->type($test_type_1)->all()->go();
     $type_2_posts = $qq->type($test_type_2)->all()->go();
     $this->assertEquals($num_type_1, count($type_1_posts));
     $this->assertEquals($num_type_2, count($type_2_posts));
     $this->assertEmpty($type_0_posts);
 }
 function test_status()
 {
     $test_post_status_0 = 'draft';
     $test_post_status_1 = 'pending';
     $test_post_status_2 = 'private';
     $basic_post_count = 5;
     $draft_post_count = 10;
     $pending_post_count = 15;
     $private_post_count = 20;
     $total_post_count = $basic_post_count + $draft_post_count + $pending_post_count + $private_post_count;
     $post_ids = $this->factory->post->create_many($basic_post_count);
     $post_draft_ids = $this->factory->post->create_many($draft_post_count, array('post_status' => $test_post_status_0));
     $post_pending_ids = $this->factory->post->create_many($pending_post_count, array('post_status' => $test_post_status_1));
     $post_private_ids = $this->factory->post->create_many($private_post_count, array('post_status' => $test_post_status_2));
     $qq = new QQuery();
     $all_posts = $qq->all()->status('any')->go();
     $draft_posts = $qq->status($test_post_status_0)->all()->go();
     $pending_posts = $qq->status($test_post_status_1)->all()->go();
     $private_and_pending_posts = $qq->status(array($test_post_status_2, $test_post_status_1))->all()->go();
     $this->assertEquals(count($all_posts), $total_post_count);
     $this->assertEquals(count($draft_posts), $draft_post_count);
     $this->assertEquals(count($pending_posts), $pending_post_count);
     $this->assertEquals(count($private_and_pending_posts), $pending_post_count + $private_post_count);
 }