Changeset 31338 for trunk/tests/phpunit/tests/post/template.php
- Timestamp:
- 02/05/2015 07:03:52 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/template.php
r30035 r31338 132 132 $this->assertEquals( $option_no_change, $output ); 133 133 } 134 135 /** 136 * @ticket 12494 137 */ 138 public function test_wp_dropdown_pages_value_field_should_default_to_ID() { 139 $p = $this->factory->post->create( array( 140 'post_type' => 'page', 141 ) ); 142 143 $found = wp_dropdown_pages( array( 144 'echo' => 0, 145 ) ); 146 147 // Should contain page ID by default. 148 $this->assertContains( 'value="' . $p . '"', $found ); 149 } 150 151 /** 152 * @ticket 12494 153 */ 154 public function test_wp_dropdown_pages_value_field_ID() { 155 $p = $this->factory->post->create( array( 156 'post_type' => 'page', 157 ) ); 158 159 $found = wp_dropdown_pages( array( 160 'echo' => 0, 161 'value_field' => 'ID', 162 ) ); 163 164 $this->assertContains( 'value="' . $p . '"', $found ); 165 } 166 167 /** 168 * @ticket 12494 169 */ 170 public function test_wp_dropdown_pages_value_field_post_name() { 171 $p = $this->factory->post->create( array( 172 'post_type' => 'page', 173 'post_name' => 'foo', 174 ) ); 175 176 $found = wp_dropdown_pages( array( 177 'echo' => 0, 178 'value_field' => 'post_name', 179 ) ); 180 181 $this->assertContains( 'value="foo"', $found ); 182 } 183 184 /** 185 * @ticket 12494 186 */ 187 public function test_wp_dropdown_pages_value_field_should_fall_back_on_ID_when_an_invalid_value_is_provided() { 188 $p = $this->factory->post->create( array( 189 'post_type' => 'page', 190 'post_name' => 'foo', 191 ) ); 192 193 $found = wp_dropdown_pages( array( 194 'echo' => 0, 195 'value_field' => 'foo', 196 ) ); 197 198 $this->assertContains( 'value="' . $p . '"', $found ); 199 } 134 200 }
Note: See TracChangeset
for help on using the changeset viewer.