Changeset 35225 for trunk/tests/phpunit/tests/post/wpUniquePostSlug.php
- Timestamp:
- 10/16/2015 09:04:12 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/wpUniquePostSlug.php
r34810 r35225 9 9 */ 10 10 public function test_non_latin_slugs() { 11 $author_id = $this->factory->user->create( array( 'role' => 'editor' ) );11 $author_id = self::$factory->user->create( array( 'role' => 'editor' ) ); 12 12 13 13 $inputs = array( … … 50 50 'post_status' => 'publish', 51 51 ); 52 $one = $this->factory->post->create( $args );52 $one = self::$factory->post->create( $args ); 53 53 $args['post_type'] = 'post-type-2'; 54 $two = $this->factory->post->create( $args );54 $two = self::$factory->post->create( $args ); 55 55 56 56 $this->assertEquals( 'some-slug', get_post( $one )->post_name ); … … 75 75 'post_status' => 'publish', 76 76 ); 77 $one = $this->factory->post->create( $args );77 $one = self::$factory->post->create( $args ); 78 78 $args['post_name'] = 'some-slug-2'; 79 $two = $this->factory->post->create( $args );79 $two = self::$factory->post->create( $args ); 80 80 81 81 $this->assertEquals( 'some-slug', get_post( $one )->post_name ); … … 98 98 'post_status' => 'publish', 99 99 ); 100 $one = $this->factory->post->create( $args );100 $one = self::$factory->post->create( $args ); 101 101 102 102 $args = array( … … 105 105 'post_name' => 'image' 106 106 ); 107 $attachment = $this->factory->attachment->create_object( 'image.jpg', $one, $args );107 $attachment = self::$factory->attachment->create_object( 'image.jpg', $one, $args ); 108 108 109 109 $args = array( … … 113 113 'post_parent' => $one 114 114 ); 115 $two = $this->factory->post->create( $args );115 $two = self::$factory->post->create( $args ); 116 116 117 117 $this->assertEquals( 'some-slug', get_post( $one )->post_name ); … … 129 129 */ 130 130 public function test_whitelisted_post_statuses_should_not_be_forced_to_be_unique( $status ) { 131 $p1 = $this->factory->post->create( array(132 'post_type' => 'post', 133 'post_name' => 'foo', 134 ) ); 135 136 $p2 = $this->factory->post->create( array(131 $p1 = self::$factory->post->create( array( 132 'post_type' => 'post', 133 'post_name' => 'foo', 134 ) ); 135 136 $p2 = self::$factory->post->create( array( 137 137 'post_type' => 'post', 138 138 ) ); … … 152 152 153 153 public function test_revisions_should_not_be_forced_to_be_unique() { 154 $p1 = $this->factory->post->create( array(155 'post_type' => 'post', 156 'post_name' => 'foo', 157 ) ); 158 159 $p2 = $this->factory->post->create( array(154 $p1 = self::$factory->post->create( array( 155 'post_type' => 'post', 156 'post_name' => 'foo', 157 ) ); 158 159 $p2 = self::$factory->post->create( array( 160 160 'post_type' => 'post', 161 161 ) ); … … 172 172 $this->set_permalink_structure( '/%postname%/' ); 173 173 174 $p = $this->factory->post->create( array(174 $p = self::$factory->post->create( array( 175 175 'post_type' => 'post', 176 176 'post_name' => 'foo', … … 187 187 $this->set_permalink_structure( '/%postname%/' ); 188 188 189 $p = $this->factory->post->create( array(189 $p = self::$factory->post->create( array( 190 190 'post_type' => 'post', 191 191 'post_name' => 'foo', … … 203 203 $this->set_permalink_structure( '/%year%/%postname%/' ); 204 204 205 $p = $this->factory->post->create( array(205 $p = self::$factory->post->create( array( 206 206 'post_type' => 'post', 207 207 'post_name' => 'foo', … … 218 218 $this->set_permalink_structure( '/%year%/%postname%/' ); 219 219 220 $p = $this->factory->post->create( array(220 $p = self::$factory->post->create( array( 221 221 'post_type' => 'post', 222 222 'post_name' => 'foo', … … 233 233 $this->set_permalink_structure( '/%year%/foo/%postname%/' ); 234 234 235 $p = $this->factory->post->create( array(235 $p = self::$factory->post->create( array( 236 236 'post_type' => 'post', 237 237 'post_name' => 'foo', … … 248 248 $this->set_permalink_structure( '/%year%/%postname%/' ); 249 249 250 $p = $this->factory->post->create( array(250 $p = self::$factory->post->create( array( 251 251 'post_type' => 'post', 252 252 'post_name' => 'foo', … … 263 263 $this->set_permalink_structure( '/%year%/%monthnum%/%postname%/' ); 264 264 265 $p = $this->factory->post->create( array(265 $p = self::$factory->post->create( array( 266 266 'post_type' => 'post', 267 267 'post_name' => 'foo', … … 278 278 $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' ); 279 279 280 $p = $this->factory->post->create( array(280 $p = self::$factory->post->create( array( 281 281 'post_type' => 'post', 282 282 'post_name' => 'foo', … … 293 293 $this->set_permalink_structure( '/%year%/%monthnum%/%postname%/' ); 294 294 295 $p = $this->factory->post->create( array(295 $p = self::$factory->post->create( array( 296 296 'post_type' => 'post', 297 297 'post_name' => 'foo',
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)