Changeset 35225 for trunk/tests/phpunit/tests/post/template.php
- Timestamp:
- 10/16/2015 09:04:12 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/template.php
r34950 r35225 9 9 $contents = array( 'One', 'Two', 'Three' ); 10 10 $content = join( '<!--nextpage-->', $contents ); 11 $post_id = $this->factory->post->create( array( 'post_content' => $content ) );11 $post_id = self::$factory->post->create( array( 'post_content' => $content ) ); 12 12 13 13 $this->go_to( '?p=' . $post_id ); … … 82 82 83 83 $bump = ' '; 84 $page_id = $this->factory->post->create( array( 'post_type' => 'page' ) ); 85 $child_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_parent' => $page_id ) ); 86 $grandchild_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_parent' => $child_id ) ); 84 $page_id = self::$factory->post->create( array( 'post_type' => 'page' ) ); 85 $child_id = self::$factory->post->create( array( 'post_type' => 'page', 'post_parent' => $page_id ) ); 86 $grandchild_id = self::$factory->post->create( array( 'post_type' => 'page', 'post_parent' => $child_id ) ); 87 88 $title1 = get_post( $page_id )->post_title; 89 $title2 = get_post( $child_id )->post_title; 90 $title3 = get_post( $grandchild_id )->post_title; 87 91 88 92 $lineage =<<<LINEAGE 89 93 <select name='page_id' id='page_id'> 90 <option class="level-0" value="$page_id"> Post title1</option>91 <option class="level-1" value="$child_id">{$bump} Post title2</option>92 <option class="level-2" value="$grandchild_id">{$bump}{$bump} Post title3</option>94 <option class="level-0" value="$page_id">$title1</option> 95 <option class="level-1" value="$child_id">{$bump}$title2</option> 96 <option class="level-2" value="$grandchild_id">{$bump}{$bump}$title3</option> 93 97 </select> 94 98 … … 100 104 $depth =<<<DEPTH 101 105 <select name='page_id' id='page_id'> 102 <option class="level-0" value="$page_id"> Post title1</option>106 <option class="level-0" value="$page_id">$title1</option> 103 107 </select> 104 108 … … 111 115 <select name='page_id' id='page_id'> 112 116 <option value="Woo">Hoo</option> 113 <option class="level-0" value="$page_id"> Post title1</option>117 <option class="level-0" value="$page_id">$title1</option> 114 118 </select> 115 119 … … 125 129 <option value="-1">Burrito</option> 126 130 <option value="Woo">Hoo</option> 127 <option class="level-0" value="$page_id"> Post title1</option>131 <option class="level-0" value="$page_id">$title1</option> 128 132 </select> 129 133 … … 140 144 */ 141 145 public function test_wp_dropdown_pages_value_field_should_default_to_ID() { 142 $p = $this->factory->post->create( array(146 $p = self::$factory->post->create( array( 143 147 'post_type' => 'page', 144 148 ) ); … … 156 160 */ 157 161 public function test_wp_dropdown_pages_value_field_ID() { 158 $p = $this->factory->post->create( array(162 $p = self::$factory->post->create( array( 159 163 'post_type' => 'page', 160 164 ) ); … … 172 176 */ 173 177 public function test_wp_dropdown_pages_value_field_post_name() { 174 $p = $this->factory->post->create( array(178 $p = self::$factory->post->create( array( 175 179 'post_type' => 'page', 176 180 'post_name' => 'foo', … … 189 193 */ 190 194 public function test_wp_dropdown_pages_value_field_should_fall_back_on_ID_when_an_invalid_value_is_provided() { 191 $p = $this->factory->post->create( array(195 $p = self::$factory->post->create( array( 192 196 'post_type' => 'page', 193 197 'post_name' => 'foo', … … 206 210 */ 207 211 public function test_wp_dropdown_pages_should_not_contain_class_attribute_when_no_class_is_passed() { 208 $p = $this->factory->post->create( array(212 $p = self::$factory->post->create( array( 209 213 'post_type' => 'page', 210 214 'post_name' => 'foo', … … 222 226 */ 223 227 public function test_wp_dropdown_pages_should_obey_class_parameter() { 224 $p = $this->factory->post->create( array(228 $p = self::$factory->post->create( array( 225 229 'post_type' => 'page', 226 230 'post_name' => 'foo', … … 239 243 */ 240 244 public function test_get_page_template_slug_by_id() { 241 $page_id = $this->factory->post->create( array(245 $page_id = self::$factory->post->create( array( 242 246 'post_type' => 'page', 243 247 ) ); … … 256 260 */ 257 261 public function test_get_page_template_slug_from_loop() { 258 $page_id = $this->factory->post->create( array(262 $page_id = self::$factory->post->create( array( 259 263 'post_type' => 'page', 260 264 ) ); … … 270 274 */ 271 275 public function test_get_page_template_slug_non_page() { 272 $post_id = $this->factory->post->create( array(276 $post_id = self::$factory->post->create( array( 273 277 'post_type' => 'post', 274 278 ) ); … … 285 289 */ 286 290 public function test_wp_page_menu_wp_nav_menu_fallback() { 287 $pages = $this->factory->post->create_many( 3, array( 'post_type' => 'page' ) );291 $pages = self::$factory->post->create_many( 3, array( 'post_type' => 'page' ) ); 288 292 289 293 // No menus + wp_nav_menu() falls back to wp_page_menu().
Note: See TracChangeset
for help on using the changeset viewer.