Changeset 42343 for trunk/tests/phpunit/tests/general/document-title.php
- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/general/document-title.php
r39172 r42343 15 15 16 16 public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) { 17 self::$category_id = $factory->category->create( array( 18 'name' => 'test_category', 19 ) ); 20 21 self::$author_id = $factory->user->create( array( 22 'role' => 'author', 23 'user_login' => 'test_author', 24 'description' => 'test_author', 25 ) ); 26 27 self::$post_id = $factory->post->create( array( 28 'post_author' => self::$author_id, 29 'post_status' => 'publish', 30 'post_title' => 'test_title', 31 'post_type' => 'post', 32 'post_date' => '2015-09-22 18:52:17', 33 'category' => self::$category_id, 34 ) ); 17 self::$category_id = $factory->category->create( 18 array( 19 'name' => 'test_category', 20 ) 21 ); 22 23 self::$author_id = $factory->user->create( 24 array( 25 'role' => 'author', 26 'user_login' => 'test_author', 27 'description' => 'test_author', 28 ) 29 ); 30 31 self::$post_id = $factory->post->create( 32 array( 33 'post_author' => self::$author_id, 34 'post_status' => 'publish', 35 'post_title' => 'test_title', 36 'post_type' => 'post', 37 'post_date' => '2015-09-22 18:52:17', 38 'category' => self::$category_id, 39 ) 40 ); 35 41 } 36 42 … … 84 90 function test_front_page_title() { 85 91 update_option( 'show_on_front', 'page' ); 86 update_option( 'page_on_front', $this->factory->post->create( array( 'post_title' => 'front-page', 'post_type' => 'page' ) ) ); 92 update_option( 93 'page_on_front', $this->factory->post->create( 94 array( 95 'post_title' => 'front-page', 96 'post_type' => 'page', 97 ) 98 ) 99 ); 87 100 add_filter( 'document_title_parts', array( $this, '_front_page_title_parts' ) ); 88 101 … … 105 118 106 119 function test_home_title() { 107 $blog_page_id = $this->factory->post->create( array( 'post_title' => 'blog-page', 'post_type' => 'page' ) ); 120 $blog_page_id = $this->factory->post->create( 121 array( 122 'post_title' => 'blog-page', 123 'post_type' => 'page', 124 ) 125 ); 108 126 update_option( 'show_on_front', 'page' ); 109 127 update_option( 'page_for_posts', $blog_page_id ); … … 166 184 167 185 function test_post_type_archive_title() { 168 register_post_type( 'cpt', array( 169 'public' => true, 170 'has_archive' => true, 171 'labels' => array( 172 'name' => 'test_cpt', 173 ), 174 ) ); 175 176 $this->factory->post->create( array( 177 'post_type' => 'cpt', 178 ) ); 186 register_post_type( 187 'cpt', array( 188 'public' => true, 189 'has_archive' => true, 190 'labels' => array( 191 'name' => 'test_cpt', 192 ), 193 ) 194 ); 195 196 $this->factory->post->create( 197 array( 198 'post_type' => 'cpt', 199 ) 200 ); 179 201 180 202 $this->go_to( '?post_type=cpt' );
Note: See TracChangeset
for help on using the changeset viewer.