Changeset 35242 for trunk/tests/phpunit/tests/query/results.php
- Timestamp:
- 10/17/2015 06:02:16 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/query/results.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/query/results.php
r35225 r35242 457 457 */ 458 458 function test_query_author_vars() { 459 $author_1 = self:: $factory->user->create( array( 'user_login' => 'admin1', 'user_pass' => rand_str(), 'role' => 'author' ) );460 $post_1 = self:: $factory->post->create( array( 'post_title' => rand_str(), 'post_author' => $author_1, 'post_date' => '2007-01-01 00:00:00' ) );461 462 $author_2 = self:: $factory->user->create( array( 'user_login' => rand_str(), 'user_pass' => rand_str(), 'role' => 'author' ) );463 $post_2 = self:: $factory->post->create( array( 'post_title' => rand_str(), 'post_author' => $author_2, 'post_date' => '2007-01-01 00:00:00' ) );464 465 $author_3 = self:: $factory->user->create( array( 'user_login' => rand_str(), 'user_pass' => rand_str(), 'role' => 'author' ) );466 $post_3 = self:: $factory->post->create( array( 'post_title' => rand_str(), 'post_author' => $author_3, 'post_date' => '2007-01-01 00:00:00' ) );467 468 $author_4 = self:: $factory->user->create( array( 'user_login' => rand_str(), 'user_pass' => rand_str(), 'role' => 'author' ) );469 $post_4 = self:: $factory->post->create( array( 'post_title' => rand_str(), 'post_author' => $author_4, 'post_date' => '2007-01-01 00:00:00' ) );459 $author_1 = self::factory()->user->create( array( 'user_login' => 'admin1', 'user_pass' => rand_str(), 'role' => 'author' ) ); 460 $post_1 = self::factory()->post->create( array( 'post_title' => rand_str(), 'post_author' => $author_1, 'post_date' => '2007-01-01 00:00:00' ) ); 461 462 $author_2 = self::factory()->user->create( array( 'user_login' => rand_str(), 'user_pass' => rand_str(), 'role' => 'author' ) ); 463 $post_2 = self::factory()->post->create( array( 'post_title' => rand_str(), 'post_author' => $author_2, 'post_date' => '2007-01-01 00:00:00' ) ); 464 465 $author_3 = self::factory()->user->create( array( 'user_login' => rand_str(), 'user_pass' => rand_str(), 'role' => 'author' ) ); 466 $post_3 = self::factory()->post->create( array( 'post_title' => rand_str(), 'post_author' => $author_3, 'post_date' => '2007-01-01 00:00:00' ) ); 467 468 $author_4 = self::factory()->user->create( array( 'user_login' => rand_str(), 'user_pass' => rand_str(), 'role' => 'author' ) ); 469 $post_4 = self::factory()->post->create( array( 'post_title' => rand_str(), 'post_author' => $author_4, 'post_date' => '2007-01-01 00:00:00' ) ); 470 470 471 471 $posts = $this->q->query( array( … … 624 624 */ 625 625 function test_post_password() { 626 $one = (string) self:: $factory->post->create( array( 'post_password' => '' ) );627 $two = (string) self:: $factory->post->create( array( 'post_password' => 'burrito' ) );628 $three = (string) self:: $factory->post->create( array( 'post_password' => 'burrito' ) );626 $one = (string) self::factory()->post->create( array( 'post_password' => '' ) ); 627 $two = (string) self::factory()->post->create( array( 'post_password' => 'burrito' ) ); 628 $three = (string) self::factory()->post->create( array( 'post_password' => 'burrito' ) ); 629 629 630 630 $args = array( 'post__in' => array( $one, $two, $three ), 'fields' => 'ids' ); … … 666 666 register_post_type( 'handbook', array( 'hierarchical' => true ) ); 667 667 668 $post_1 = self:: $factory->post->create( array( 'post_title' => 'Getting Started', 'post_type' => 'handbook' ) );669 $post_2 = self:: $factory->post->create( array( 'post_title' => 'Contributing to the WordPress Codex', 'post_type' => 'handbook' ) );670 $post_3 = self:: $factory->post->create( array( 'post_title' => 'Getting Started', 'post_parent' => $post_2, 'post_type' => 'handbook' ) );668 $post_1 = self::factory()->post->create( array( 'post_title' => 'Getting Started', 'post_type' => 'handbook' ) ); 669 $post_2 = self::factory()->post->create( array( 'post_title' => 'Contributing to the WordPress Codex', 'post_type' => 'handbook' ) ); 670 $post_3 = self::factory()->post->create( array( 'post_title' => 'Getting Started', 'post_parent' => $post_2, 'post_type' => 'handbook' ) ); 671 671 672 672 $result = $this->q->query( array( 'handbook' => 'getting-started', 'post_type' => 'handbook' ) ); … … 680 680 register_post_type( 'handbook', array( 'hierarchical' => true ) ); 681 681 682 $post_1 = self:: $factory->post->create( array( 'post_title' => 'Contributing to the WordPress Codex', 'post_type' => 'handbook' ) );683 $post_2 = self:: $factory->post->create( array( 'post_title' => 'Getting Started', 'post_parent' => $post_1, 'post_type' => 'handbook' ) );682 $post_1 = self::factory()->post->create( array( 'post_title' => 'Contributing to the WordPress Codex', 'post_type' => 'handbook' ) ); 683 $post_2 = self::factory()->post->create( array( 'post_title' => 'Getting Started', 'post_parent' => $post_1, 'post_type' => 'handbook' ) ); 684 684 685 685 $this->assertContains( 'contributing-to-the-wordpress-codex/getting-started', get_permalink( $post_2 ) ); … … 691 691 function test_title() { 692 692 $title = 'Tacos are Cool'; 693 $post_id = self:: $factory->post->create( array(693 $post_id = self::factory()->post->create( array( 694 694 'post_title' => $title, 695 695 'post_type' => 'post',
Note: See TracChangeset
for help on using the changeset viewer.