Changeset 35191
- Timestamp:
- 10/15/2015 05:50:40 AM (9 years ago)
- Location:
- trunk/tests/phpunit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase-canonical.php
r34802 r35191 39 39 * @since 4.1.0 40 40 */ 41 public static function generate_shared_fixtures() { 42 global $wp_rewrite; 43 44 $factory = new WP_UnitTest_Factory; 45 41 public static function generate_shared_fixtures( $factory ) { 46 42 self::$old_current_user = get_current_user_id(); 47 43 self::$author_id = $factory->user->create( array( 'user_login' => 'canonical-author' ) ); … … 131 127 $tag1 = $factory->term->create( array( 'name' => 'post-formats' ) ); 132 128 self::$term_ids[ $tag1 ] = 'post_tag'; 133 134 self::commit_transaction();135 129 } 136 130 … … 141 135 */ 142 136 public static function delete_shared_fixtures() { 143 global $wp_rewrite;144 145 137 if ( is_multisite() ) { 146 138 wpmu_delete_user( self::$author_id ); … … 166 158 self::$term_ids = array(); 167 159 self::$terms = array(); 168 169 self::commit_transaction();170 160 } 171 161 -
trunk/tests/phpunit/tests/canonical.php
r35177 r35191 10 10 */ 11 11 class Tests_Canonical extends WP_Canonical_UnitTestCase { 12 public static function setUpBeforeClass() {13 self::generate_shared_fixtures( );12 public static function wpSetUpBeforeClass( $factory ) { 13 self::generate_shared_fixtures( $factory ); 14 14 } 15 15 16 public static function tearDownAfterClass() {16 public static function wpTearDownAfterClass() { 17 17 self::delete_shared_fixtures(); 18 18 } -
trunk/tests/phpunit/tests/canonical/noRewrite.php
r30277 r35191 11 11 12 12 // These test cases are run against the test handler in WP_Canonical 13 public static function setUpBeforeClass() {14 self::generate_shared_fixtures( );13 public static function wpSetUpBeforeClass( $factory ) { 14 self::generate_shared_fixtures( $factory ); 15 15 } 16 16 17 public static function tearDownAfterClass() {17 public static function wpTearDownAfterClass() { 18 18 self::delete_shared_fixtures(); 19 19 } … … 27 27 $wp_rewrite->set_permalink_structure( '' ); 28 28 $wp_rewrite->flush_rules(); 29 $wp_rewrite->init();30 29 } 31 30 -
trunk/tests/phpunit/tests/canonical/pageOnFront.php
r31622 r35191 7 7 */ 8 8 class Tests_Canonical_PageOnFront extends WP_Canonical_UnitTestCase { 9 public static function setUpBeforeClass() {10 self::generate_shared_fixtures( );9 public static function wpSetUpBeforeClass( $factory ) { 10 self::generate_shared_fixtures( $factory ); 11 11 } 12 12 13 public static function tearDownAfterClass() {13 public static function wpTearDownAfterClass() { 14 14 self::delete_shared_fixtures(); 15 15 } … … 17 17 function setUp() { 18 18 parent::setUp(); 19 global $wp_rewrite; 19 20 20 update_option( 'show_on_front', 'page' ); 21 21 update_option( 'page_for_posts', $this->factory->post->create( array( 'post_title' => 'blog-page', 'post_type' => 'page' ) ) ); 22 22 update_option( 'page_on_front', $this->factory->post->create( array( 'post_title' => 'front-page', 'post_type' => 'page' ) ) ); 23 $wp_rewrite->init();24 $wp_rewrite->flush_rules();25 }26 27 function tearDown() {28 global $wp_rewrite;29 $wp_rewrite->init();30 parent::tearDown();31 23 } 32 24
Note: See TracChangeset
for help on using the changeset viewer.