Changeset 1279 in tests
- Timestamp:
- 05/10/2013 06:42:23 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/post/getPages.php
r1208 r1279 93 93 $this->assertInstanceOf( 'WP_Post', $page ); 94 94 } 95 96 /** 97 * @ticket 20376 98 */ 99 function test_get_pages_meta() { 100 $posts = $this->factory->post->create_many( 3, array( 'post_type' => 'page' ) ); 101 add_post_meta( $posts[0], 'some-meta-key', '0' ); 102 add_post_meta( $posts[1], 'some-meta-key', '' ); 103 add_post_meta( $posts[2], 'some-meta-key', '1' ); 104 105 $this->assertEquals( 1, count( get_pages( array( 'meta_key' => 'some-meta-key', 'meta_value' => '0' ) ) ) ); 106 $this->assertEquals( 1, count( get_pages( array( 'meta_key' => 'some-meta-key', 'meta_value' => '1' ) ) ) ); 107 $this->assertEquals( 3, count( get_pages( array( 'meta_key' => 'some-meta-key' ) ) ) ); 108 } 109 110 /** 111 * @ticket 22389 112 */ 113 function test_wp_dropdown_pages() { 114 $posts = $this->factory->post->create_many( 5, array( 'post_type' => 'page' ) ); 115 116 preg_match_all( '#<option#', wp_dropdown_pages( 'echo=0' ), $matches ); 117 118 $this->assertEquals( 5, count( $matches[0] ) ); 119 } 95 120 }
Note: See TracChangeset
for help on using the changeset viewer.