Changeset 865 in tests
- Timestamp:
- 07/02/2012 06:15:04 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
phpunit.xml (modified) (1 diff)
-
wp-testcase/test_includes_formatting.php (modified) (1 diff)
-
wp-testcase/test_query.php (modified) (9 diffs)
-
wp-testcase/test_user.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpunit.xml
r853 r865 8 8 <testsuite> 9 9 <directory suffix=".php">wp-testcase</directory> 10 <exclude>wp-testcase/test_query_results.php</exclude> 10 11 </testsuite> 11 12 </testsuites> -
trunk/wp-testcase/test_includes_formatting.php
r834 r865 315 315 316 316 /** 317 * @ticket 16892317 * ticket 16892 318 318 */ 319 319 function test_no_segfault() { -
trunk/wp-testcase/test_query.php
r864 r865 31 31 parent::tearDown(); 32 32 $GLOBALS['wp_rewrite']->init(); 33 }34 35 function _all_post_ids( $type='post' ) {36 global $wpdb;37 return $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_type = %s and post_status='publish'", $type ) );38 33 } 39 34 … … 100 95 function test_post_comments_feed() { 101 96 $post_id = $this->factory->post->create( array( 'post_title' => 'hello-world' ) ); 102 // Comments aren't needed for this test to pass. 103 // $this->factory->comment->create_post_comments( $post_id, 2 ); 97 $this->factory->comment->create_post_comments( $post_id, 2 ); 98 $this->go_to( get_post_comments_feed_link( $post_id ) ); 99 $this->assertQueryTrue('is_feed', 'is_single', 'is_singular', 'is_comment_feed'); 100 } 101 102 103 function test_post_comments_feed_with_no_comments() { 104 $post_id = $this->factory->post->create( array( 'post_title' => 'hello-world' ) ); 104 105 $this->go_to( get_post_comments_feed_link( $post_id ) ); 105 106 $this->assertQueryTrue('is_feed', 'is_single', 'is_singular', 'is_comment_feed'); … … 162 163 $page_ids[] = $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'child-page-2', 'post_parent' => $page_id ) ); 163 164 foreach ( $page_ids as $page_id ) { 164 // Comments aren't needed for this test to pass. 165 // $this->factory->comment->create_post_comments( $page_id, 2 ); 166 165 $this->factory->comment->create_post_comments( $page_id, 2 ); 167 166 $url = get_permalink( $page_id ); 168 167 $this->go_to("{$url}feed/"); … … 175 174 $this->assertEquals( $page_id, $wp_query->get_queried_object()->ID ); 176 175 } 177 176 } 177 178 function test_page_feed_with_no_comments() { 179 $page_ids = array(); 180 $page_ids[] = $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'parent-page' ) ); 181 $page_ids[] = $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'child-page-1', 'post_parent' => $page_id ) ); 182 $page_ids[] = $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'child-page-2', 'post_parent' => $page_id ) ); 183 foreach ( $page_ids as $page_id ) { 184 $url = get_permalink( $page_id ); 185 $this->go_to("{$url}feed/"); 186 187 // make sure the correct wp_query flags are set 188 $this->assertQueryTrue('is_page', 'is_singular', 'is_feed', 'is_comment_feed'); 189 190 // make sure the correct page was fetched 191 global $wp_query; 192 $this->assertEquals( $page_id, $wp_query->get_queried_object()->ID ); 193 } 178 194 } 179 195 … … 185 201 $page_ids[] = $page_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'child-page-2', 'post_parent' => $page_id ) ); 186 202 foreach ( $page_ids as $page_id ) { 187 // Comments aren't needed for this test to pass. 188 // $this->factory->comment->create_post_comments( $page_id, 2 ); 203 $this->factory->comment->create_post_comments( $page_id, 2 ); 189 204 190 205 $url = get_permalink( $page_id ); … … 344 359 345 360 function test_search_encoded_chars() { 346 //$this->knownWPBug(13961);361 $this->knownWPBug(13961); 347 362 $this->go_to('/search/F%C3%BCnf%2Bbar/'); 348 363 $this->assertEquals( get_query_var( 's' ), 'Fünf+bar' ); … … 406 421 foreach ( $post_ids as $post_id ) 407 422 $this->factory->term->add_post_terms( $post_id, 'tag-a', 'post_tag' ); 408 // $this->markTestSkipped(); // tag-a doesn't have enough posts -> 404409 423 $this->go_to('/tag/tag-a/page/2/'); 410 424 $this->assertQueryTrue('is_archive', 'is_tag', 'is_paged'); … … 448 462 function test_author() { 449 463 $user_id = $this->factory->user->create( array( 'user_login' => 'user-a' ) ); 450 // A post isn't needed for this test to pass. 451 // $this->factory->post->create( array( 'post_author' => $user_id ) ); 464 $this->factory->post->create( array( 'post_author' => $user_id ) ); 465 $this->go_to('/author/user-a/'); 466 $this->assertQueryTrue('is_archive', 'is_author'); 467 } 468 469 function test_author_with_no_posts() { 470 $user_id = $this->factory->user->create( array( 'user_login' => 'user-a' ) ); 452 471 $this->go_to('/author/user-a/'); 453 472 $this->assertQueryTrue('is_archive', 'is_author'); … … 588 607 'post_content' => 'Page 1 <!--nextpage--> Page 2' 589 608 ) ); 590 // $this->markTestSkipped(); // @todo post doesn't exist in Data Set 1591 // and the short version592 609 $this->go_to('/2007/09/04/a-post-with-multiple-pages/2/'); 593 610 // should is_paged be true also? -
trunk/wp-testcase/test_user.php
r828 r865 217 217 218 218 /** 219 * @ticket 19265219 * ticket 19265 220 220 */ 221 221 function test_user_level_property_back_compat() { … … 381 381 382 382 /** 383 * @ticket 19595383 * ticket 19595 384 384 */ 385 385 function test_global_userdata() { … … 398 398 399 399 /** 400 * @ticket 19769400 * ticket 19769 401 401 */ 402 402 function test_global_userdata_is_null_when_logged_out() {
Note: See TracChangeset
for help on using the changeset viewer.