Changeset 27016 for trunk/tests/phpunit/tests/query/conditionals.php
- Timestamp:
- 01/22/2014 10:30:36 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/query/conditionals.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/query/conditionals.php
r26005 r27016 671 671 $query->set( 'post_type', array( 'post', 'thearray' ) ); 672 672 } 673 674 function test_is_single() { 675 $post_id = $this->factory->post->create(); 676 $this->go_to( "/?p=$post_id" ); 677 678 $post = get_queried_object(); 679 680 $this->assertTrue( is_single() ); 681 $this->assertTrue( is_single( $post ) ); 682 $this->assertTrue( is_single( $post->ID ) ); 683 $this->assertTrue( is_single( $post->post_title ) ); 684 $this->assertTrue( is_single( $post->post_name ) ); 685 } 686 687 function test_is_page() { 688 $post_id = $this->factory->post->create( array( 'post_type' => 'page' ) ); 689 $this->go_to( "/?page_id=$post_id" ); 690 691 $post = get_queried_object(); 692 693 $this->assertTrue( is_page() ); 694 $this->assertTrue( is_page( $post ) ); 695 $this->assertTrue( is_page( $post->ID ) ); 696 $this->assertTrue( is_page( $post->post_title ) ); 697 $this->assertTrue( is_page( $post->post_name ) ); 698 } 699 700 function test_is_attachment() { 701 $post_id = $this->factory->post->create( array( 'post_type' => 'attachment' ) ); 702 $this->go_to( "/?attachment_id=$post_id" ); 703 704 $post = get_queried_object(); 705 706 $this->assertTrue( is_attachment() ); 707 $this->assertTrue( is_attachment( $post ) ); 708 $this->assertTrue( is_attachment( $post->ID ) ); 709 $this->assertTrue( is_attachment( $post->post_title ) ); 710 $this->assertTrue( is_attachment( $post->post_name ) ); 711 } 673 712 }
Note: See TracChangeset
for help on using the changeset viewer.