Changeset 48939 for trunk/tests/phpunit/tests/rewrite/rewriteTags.php
- Timestamp:
- 09/04/2020 07:01:00 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rewrite/rewriteTags.php
r44577 r48939 49 49 50 50 add_rewrite_tag( $tag, $regex ); 51 $this->assert EqualSets( $this->rewritecode, $wp_rewrite->rewritecode );52 $this->assert EqualSets( $this->rewritereplace, $wp_rewrite->rewritereplace );53 $this->assert EqualSets( $this->queryreplace, $wp_rewrite->queryreplace );51 $this->assertSameSets( $this->rewritecode, $wp_rewrite->rewritecode ); 52 $this->assertSameSets( $this->rewritereplace, $wp_rewrite->rewritereplace ); 53 $this->assertSameSets( $this->queryreplace, $wp_rewrite->queryreplace ); 54 54 } 55 55 … … 61 61 add_rewrite_tag( '%foo%', 'bar' ); 62 62 63 $this->assert EqualSets( $rewritecode, $wp_rewrite->rewritecode );64 $this->assert EqualSets( array_merge( $this->rewritereplace, array( 'bar' ) ), $wp_rewrite->rewritereplace );65 $this->assert EqualSets( array_merge( $this->queryreplace, array( 'foo=' ) ), $wp_rewrite->queryreplace );63 $this->assertSameSets( $rewritecode, $wp_rewrite->rewritecode ); 64 $this->assertSameSets( array_merge( $this->rewritereplace, array( 'bar' ) ), $wp_rewrite->rewritereplace ); 65 $this->assertSameSets( array_merge( $this->queryreplace, array( 'foo=' ) ), $wp_rewrite->queryreplace ); 66 66 } 67 67 … … 73 73 add_rewrite_tag( '%foo%', 'bar', 'baz=' ); 74 74 75 $this->assert EqualSets( $rewritecode, $wp_rewrite->rewritecode );76 $this->assert EqualSets( array_merge( $this->rewritereplace, array( 'bar' ) ), $wp_rewrite->rewritereplace );77 $this->assert EqualSets( array_merge( $this->queryreplace, array( 'baz=' ) ), $wp_rewrite->queryreplace );75 $this->assertSameSets( $rewritecode, $wp_rewrite->rewritecode ); 76 $this->assertSameSets( array_merge( $this->rewritereplace, array( 'bar' ) ), $wp_rewrite->rewritereplace ); 77 $this->assertSameSets( array_merge( $this->queryreplace, array( 'baz=' ) ), $wp_rewrite->queryreplace ); 78 78 } 79 79 … … 95 95 $rewritecode[] = '%foo%'; 96 96 add_rewrite_tag( '%foo%', 'bar', 'baz=' ); 97 $this->assert EqualSets( $rewritecode, $wp_rewrite->rewritecode );98 $this->assert EqualSets( array_merge( $this->rewritereplace, array( 'bar' ) ), $wp_rewrite->rewritereplace );99 $this->assert EqualSets( array_merge( $this->queryreplace, array( 'baz=' ) ), $wp_rewrite->queryreplace );97 $this->assertSameSets( $rewritecode, $wp_rewrite->rewritecode ); 98 $this->assertSameSets( array_merge( $this->rewritereplace, array( 'bar' ) ), $wp_rewrite->rewritereplace ); 99 $this->assertSameSets( array_merge( $this->queryreplace, array( 'baz=' ) ), $wp_rewrite->queryreplace ); 100 100 101 101 remove_rewrite_tag( '%foo%' ); 102 $this->assert EqualSets( $this->rewritecode, $wp_rewrite->rewritecode );103 $this->assert EqualSets( $this->rewritereplace, $wp_rewrite->rewritereplace );104 $this->assert EqualSets( $this->queryreplace, $wp_rewrite->queryreplace );102 $this->assertSameSets( $this->rewritecode, $wp_rewrite->rewritecode ); 103 $this->assertSameSets( $this->rewritereplace, $wp_rewrite->rewritereplace ); 104 $this->assertSameSets( $this->queryreplace, $wp_rewrite->queryreplace ); 105 105 } 106 106 … … 127 127 $rewritereplace[] = '([0-9]{1,2})'; 128 128 add_rewrite_tag( '%foo%', '([0-9]{1,2})', 'post_type=foo&name=' ); 129 $this->assert EqualSets( $rewritecode, $wp_rewrite->rewritecode );130 $this->assert EqualSets( $rewritereplace, $wp_rewrite->rewritereplace );131 $this->assert EqualSets( array_merge( $this->queryreplace, array( 'post_type=foo&name=' ) ), $wp_rewrite->queryreplace );129 $this->assertSameSets( $rewritecode, $wp_rewrite->rewritecode ); 130 $this->assertSameSets( $rewritereplace, $wp_rewrite->rewritereplace ); 131 $this->assertSameSets( array_merge( $this->queryreplace, array( 'post_type=foo&name=' ) ), $wp_rewrite->queryreplace ); 132 132 133 133 remove_rewrite_tag( '%foo%' ); 134 $this->assert EqualSets( $this->rewritecode, $wp_rewrite->rewritecode );135 $this->assert EqualSets( $this->rewritereplace, $wp_rewrite->rewritereplace );136 $this->assert EqualSets( $this->queryreplace, $wp_rewrite->queryreplace );134 $this->assertSameSets( $this->rewritecode, $wp_rewrite->rewritecode ); 135 $this->assertSameSets( $this->rewritereplace, $wp_rewrite->rewritereplace ); 136 $this->assertSameSets( $this->queryreplace, $wp_rewrite->queryreplace ); 137 137 138 138 $this->assertNotContains( '%foo%', $wp_rewrite->rewritecode );
Note: See TracChangeset
for help on using the changeset viewer.