Changeset 35483 for trunk/tests/phpunit/tests/customize/manager.php
- Timestamp:
- 11/01/2015 06:39:50 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/manager.php
r35307 r35483 253 253 function test_return_url() { 254 254 wp_set_current_user( self::factory()->user->create( array( 'role' => 'author' ) ) ); 255 $this->assertEquals( get_admin_url(), $this->manager->get_return_url() );255 $this->assertEquals( home_url( '/' ), $this->manager->get_return_url() ); 256 256 257 257 wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); 258 258 $this->assertTrue( current_user_can( 'edit_theme_options' ) ); 259 $this->assertEquals( admin_url( 'themes.php' ), $this->manager->get_return_url() );259 $this->assertEquals( home_url( '/' ), $this->manager->get_return_url() ); 260 260 261 261 $preview_url = home_url( '/foo/' ); 262 262 $this->manager->set_preview_url( $preview_url ); 263 $this->assertEquals( $preview_url, $this->manager->get_return_url() ); 264 265 $url = home_url( '/referred/' ); 266 $_SERVER['HTTP_REFERER'] = wp_slash( $url ); 267 $this->assertEquals( $url, $this->manager->get_return_url() ); 268 269 $url = 'http://badreferer.example.com/'; 270 $_SERVER['HTTP_REFERER'] = wp_slash( $url ); 271 $this->assertNotEquals( $url, $this->manager->get_return_url() ); 263 272 $this->assertEquals( $preview_url, $this->manager->get_return_url() ); 264 273
Note: See TracChangeset
for help on using the changeset viewer.