Changeset 36717
- Timestamp:
- 02/26/2016 12:25:10 AM (10 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 3 edited
-
functions/referer.php (modified) (9 diffs)
-
rewrite/numericSlugs.php (modified) (2 diffs)
-
upload.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/functions/referer.php
r36266 r36717 24 24 25 25 public function _fake_subfolder_install() { 26 return 'http:// example.org/subfolder';26 return 'http://' . WP_TESTS_DOMAIN . '/subfolder'; 27 27 } 28 28 29 29 public function filter_allowed_redirect_hosts( $hosts ) { 30 $hosts[] = 'another. example.org';30 $hosts[] = 'another.' . WP_TESTS_DOMAIN; 31 31 32 32 return $hosts; … … 40 40 41 41 public function test_from_request_same_url() { 42 $_REQUEST['_wp_http_referer'] = addslashes( 'http:// example.org/test.php?id=123' );42 $_REQUEST['_wp_http_referer'] = addslashes( 'http://' . WP_TESTS_DOMAIN . '/test.php?id=123' ); 43 43 $_SERVER['REQUEST_URI'] = addslashes( '/test.php?id=123' ); 44 44 $this->assertFalse( wp_get_referer() ); … … 46 46 47 47 public function test_from_request_different_resource() { 48 $_REQUEST['_wp_http_referer'] = addslashes( 'http:// example.org/another.php?id=123' );48 $_REQUEST['_wp_http_referer'] = addslashes( 'http://' . WP_TESTS_DOMAIN . '/another.php?id=123' ); 49 49 $_SERVER['REQUEST_URI'] = addslashes( '/test.php?id=123' ); 50 $this->assertSame( 'http:// example.org/another.php?id=123', wp_get_referer() );50 $this->assertSame( 'http://' . WP_TESTS_DOMAIN . '/another.php?id=123', wp_get_referer() ); 51 51 } 52 52 53 53 public function test_from_request_different_query_args() { 54 $_REQUEST['_wp_http_referer'] = addslashes( 'http:// example.org/test.php?another=555' );54 $_REQUEST['_wp_http_referer'] = addslashes( 'http://' . WP_TESTS_DOMAIN . '/test.php?another=555' ); 55 55 $_SERVER['REQUEST_URI'] = addslashes( '/test.php?id=123' ); 56 $this->assertSame( 'http:// example.org/test.php?another=555', wp_get_referer() );56 $this->assertSame( 'http://' . WP_TESTS_DOMAIN . '/test.php?another=555', wp_get_referer() ); 57 57 } 58 58 … … 63 63 add_filter( 'site_url', array( $this, '_fake_subfolder_install' ) ); 64 64 65 $_REQUEST['_wp_http_referer'] = addslashes( 'http:// example.org/subfolder/test.php?id=123' );65 $_REQUEST['_wp_http_referer'] = addslashes( 'http://' . WP_TESTS_DOMAIN . '/subfolder/test.php?id=123' ); 66 66 $_SERVER['REQUEST_URI'] = addslashes( '/subfolder/test.php?id=123' ); 67 67 $this->assertFalse( wp_get_referer() ); … … 76 76 add_filter( 'site_url', array( $this, '_fake_subfolder_install' ) ); 77 77 78 $_REQUEST['_wp_http_referer'] = addslashes( 'http:// example.org/subfolder/another.php?id=123' );78 $_REQUEST['_wp_http_referer'] = addslashes( 'http://' . WP_TESTS_DOMAIN . '/subfolder/another.php?id=123' ); 79 79 $_SERVER['REQUEST_URI'] = addslashes( '/subfolder/test.php?id=123' ); 80 $this->assertSame( 'http:// example.org/subfolder/another.php?id=123', wp_get_referer() );80 $this->assertSame( 'http://' . WP_TESTS_DOMAIN . '/subfolder/another.php?id=123', wp_get_referer() ); 81 81 82 82 remove_filter( 'site_url', array( $this, '_fake_subfolder_install' ) ); … … 90 90 91 91 public function test_same_url() { 92 $_SERVER['HTTP_REFERER'] = addslashes( 'http:// example.org/test.php?id=123' );92 $_SERVER['HTTP_REFERER'] = addslashes( 'http://' . WP_TESTS_DOMAIN . '/test.php?id=123' ); 93 93 $_SERVER['REQUEST_URI'] = addslashes( '/test.php?id=123' ); 94 94 $this->assertFalse( wp_get_referer() ); … … 96 96 97 97 public function test_different_resource() { 98 $_SERVER['HTTP_REFERER'] = addslashes( 'http:// example.org/another.php?id=123' );98 $_SERVER['HTTP_REFERER'] = addslashes( 'http://' . WP_TESTS_DOMAIN . '/another.php?id=123' ); 99 99 $_SERVER['REQUEST_URI'] = addslashes( '/test.php?id=123' ); 100 $this->assertSame( 'http:// example.org/another.php?id=123', wp_get_referer() );100 $this->assertSame( 'http://' . WP_TESTS_DOMAIN . '/another.php?id=123', wp_get_referer() ); 101 101 } 102 102 … … 106 106 */ 107 107 public function test_different_server() { 108 $_SERVER['HTTP_REFERER'] = addslashes( 'http://another. example.org/test.php?id=123' );108 $_SERVER['HTTP_REFERER'] = addslashes( 'http://another.' . WP_TESTS_DOMAIN . '/test.php?id=123' ); 109 109 $_SERVER['REQUEST_URI'] = addslashes( '/test.php?id=123' ); 110 110 $this->assertFalse( wp_get_referer() ); … … 117 117 public function test_different_server_allowed_redirect_host() { 118 118 add_filter( 'allowed_redirect_hosts', array( $this, 'filter_allowed_redirect_hosts' ) ); 119 $_SERVER['HTTP_REFERER'] = addslashes( 'http://another. example.org/test.php?id=123' );119 $_SERVER['HTTP_REFERER'] = addslashes( 'http://another.' . WP_TESTS_DOMAIN . '/test.php?id=123' ); 120 120 $_SERVER['REQUEST_URI'] = addslashes( '/test.php?id=123' ); 121 $this->assertSame( 'http://another. example.org/test.php?id=123', wp_get_referer() );121 $this->assertSame( 'http://another.' . WP_TESTS_DOMAIN . '/test.php?id=123', wp_get_referer() ); 122 122 remove_filter( 'allowed_redirect_hosts', array( $this, 'filter_allowed_redirect_hosts' ) ); 123 123 } -
trunk/tests/phpunit/tests/rewrite/numericSlugs.php
r35242 r36717 38 38 array( 39 39 'ID' => '2015', 40 'guid' => 'http:// example.org/?p=2015'40 'guid' => 'http://' . WP_TESTS_DOMAIN . '/?p=2015' 41 41 ), 42 42 array( 'ID' => $id ) … … 66 66 array( 67 67 'ID' => '2015', 68 'guid' => 'http:// example.org/?p=2015'68 'guid' => 'http://' . WP_TESTS_DOMAIN . '/?p=2015' 69 69 ), 70 70 array( 'ID' => $id ) -
trunk/tests/phpunit/tests/upload.php
r36565 r36717 83 83 84 84 function test_upload_path_absolute() { 85 update_option( 'upload_url_path', 'http:// example.org/asdf' );85 update_option( 'upload_url_path', 'http://' . WP_TESTS_DOMAIN . '/asdf' ); 86 86 87 87 // Use `_wp_upload_dir()` directly to bypass caching and work with the changed options. … … 90 90 $subdir = gmstrftime('/%Y/%m'); 91 91 92 $this->assertEquals( 'http:// example.org/asdf' . $subdir, $info['url'] );92 $this->assertEquals( 'http://' . WP_TESTS_DOMAIN . '/asdf' . $subdir, $info['url'] ); 93 93 $this->assertEquals( ABSPATH . 'wp-content/uploads' . $subdir, $info['path'] ); 94 94 $this->assertEquals( $subdir, $info['subdir'] );
Note: See TracChangeset
for help on using the changeset viewer.