Changeset 48937 for trunk/tests/phpunit/tests/post/wpUniquePostSlug.php
- Timestamp:
- 09/02/2020 12:35:36 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/wpUniquePostSlug.php
r48121 r48937 37 37 38 38 $post = get_post( $id ); 39 $this->assert Equals( $outputs[ $k ], urldecode( $post->post_name ) );39 $this->assertSame( $outputs[ $k ], urldecode( $post->post_name ) ); 40 40 } 41 41 } … … 57 57 $two = self::factory()->post->create( $args ); 58 58 59 $this->assert Equals( 'some-slug', get_post( $one )->post_name );60 $this->assert Equals( 'some-slug', get_post( $two )->post_name );61 62 $this->assert Equals( 'some-other-slug', wp_unique_post_slug( 'some-other-slug', $one, 'publish', 'post-type-1', 0 ) );63 $this->assert Equals( 'some-other-slug', wp_unique_post_slug( 'some-other-slug', $one, 'publish', 'post-type-2', 0 ) );59 $this->assertSame( 'some-slug', get_post( $one )->post_name ); 60 $this->assertSame( 'some-slug', get_post( $two )->post_name ); 61 62 $this->assertSame( 'some-other-slug', wp_unique_post_slug( 'some-other-slug', $one, 'publish', 'post-type-1', 0 ) ); 63 $this->assertSame( 'some-other-slug', wp_unique_post_slug( 'some-other-slug', $one, 'publish', 'post-type-2', 0 ) ); 64 64 65 65 _unregister_post_type( 'post-type-1' ); … … 82 82 $two = self::factory()->post->create( $args ); 83 83 84 $this->assert Equals( 'some-slug', get_post( $one )->post_name );85 $this->assert Equals( 'some-slug-2', get_post( $two )->post_name );86 87 $this->assert Equals( 'some-slug-3', wp_unique_post_slug( 'some-slug', 0, 'publish', 'post-type-1', 0 ) );84 $this->assertSame( 'some-slug', get_post( $one )->post_name ); 85 $this->assertSame( 'some-slug-2', get_post( $two )->post_name ); 86 87 $this->assertSame( 'some-slug-3', wp_unique_post_slug( 'some-slug', 0, 'publish', 'post-type-1', 0 ) ); 88 88 89 89 _unregister_post_type( 'post-type-1' ); … … 118 118 $two = self::factory()->post->create( $args ); 119 119 120 $this->assert Equals( 'some-slug', get_post( $one )->post_name );121 $this->assert Equals( 'image', get_post( $attachment )->post_name );122 $this->assert Equals( 'image-2', get_post( $two )->post_name );120 $this->assertSame( 'some-slug', get_post( $one )->post_name ); 121 $this->assertSame( 'image', get_post( $attachment )->post_name ); 122 $this->assertSame( 'image-2', get_post( $two )->post_name ); 123 123 124 124 // 'image' can be a child of image-2. 125 $this->assert Equals( 'image', wp_unique_post_slug( 'image', 0, 'publish', 'post-type-1', $two ) );125 $this->assertSame( 'image', wp_unique_post_slug( 'image', 0, 'publish', 'post-type-1', $two ) ); 126 126 127 127 _unregister_post_type( 'post-type-1' ); … … 191 191 192 192 $found = wp_unique_post_slug( '2015', $p, 'publish', 'post', 0 ); 193 $this->assert Equals( '2015-2', $found );193 $this->assertSame( '2015-2', $found ); 194 194 } 195 195 … … 209 209 210 210 $found = wp_unique_post_slug( '2015', $p, 'publish', 'post', 0 ); 211 $this->assert Equals( '2015-2', $found );211 $this->assertSame( '2015-2', $found ); 212 212 } 213 213 … … 226 226 227 227 $found = wp_unique_post_slug( '2015', $p, 'publish', 'post', 0 ); 228 $this->assert Equals( '2015', $found );228 $this->assertSame( '2015', $found ); 229 229 } 230 230 … … 243 243 244 244 $found = wp_unique_post_slug( '11', $p, 'publish', 'post', 0 ); 245 $this->assert Equals( '11-2', $found );245 $this->assertSame( '11-2', $found ); 246 246 } 247 247 … … 260 260 261 261 $found = wp_unique_post_slug( '11', $p, 'publish', 'post', 0 ); 262 $this->assert Equals( '11', $found );262 $this->assertSame( '11', $found ); 263 263 } 264 264 … … 277 277 278 278 $found = wp_unique_post_slug( '13', $p, 'publish', 'post', 0 ); 279 $this->assert Equals( '13', $found );279 $this->assertSame( '13', $found ); 280 280 } 281 281 … … 294 294 295 295 $found = wp_unique_post_slug( '30', $p, 'publish', 'post', 0 ); 296 $this->assert Equals( '30-2', $found );296 $this->assertSame( '30-2', $found ); 297 297 } 298 298 … … 311 311 312 312 $found = wp_unique_post_slug( '30', $p, 'publish', 'post', 0 ); 313 $this->assert Equals( '30', $found );313 $this->assertSame( '30', $found ); 314 314 } 315 315 … … 328 328 329 329 $found = wp_unique_post_slug( '32', $p, 'publish', 'post', 0 ); 330 $this->assert Equals( '32', $found );330 $this->assertSame( '32', $found ); 331 331 } 332 332
Note: See TracChangeset
for help on using the changeset viewer.