Changeset 903 in tests for trunk/tests/test_http.php
- Timestamp:
- 07/16/2012 05:24:25 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/test_http.php
r894 r903 220 220 return; 221 221 } 222 222 223 223 $actual = WP_HTTP::make_absolute_url( $relative_url, $absolute_url ); 224 224 $this->assertEquals( $expected, $actual ); … … 230 230 array( 'http://site.com/', 'http://example.com/', 'http://site.com/' ), // Absolute URL provided 231 231 array( '/location', '', '/location' ), // No current url provided 232 232 233 233 array( '', 'http://example.com', 'http://example.com/' ), // No location provided 234 234 235 235 // Location provided relative to site root 236 236 array( '/root-relative-link.ext', 'http://example.com/', 'http://example.com/root-relative-link.ext' ), 237 237 array( '/root-relative-link.ext?with=query', 'http://example.com/index.ext?query', 'http://example.com/root-relative-link.ext?with=query' ), 238 238 239 239 // Location provided relative to current file/directory 240 240 array( 'relative-file.ext', 'http://example.com/', 'http://example.com/relative-file.ext' ), 241 241 array( 'relative-file.ext', 'http://example.com/filename', 'http://example.com/relative-file.ext' ), 242 242 array( 'relative-file.ext', 'http://example.com/directory/', 'http://example.com/directory/relative-file.ext' ), 243 243 244 244 // Location provided relative to current file/directory but in a parent directory 245 245 array( '../file-in-parent.ext', 'http://example.com', 'http://example.com/file-in-parent.ext' ), … … 254 254 array( '../../file-in-grand-parent.ext', 'http://example.com/directory/filename/', 'http://example.com/file-in-grand-parent.ext' ), 255 255 array( '../../file-in-grand-parent.ext', 'http://example.com/directory1/directory2/filename', 'http://example.com/file-in-grand-parent.ext' ), 256 256 257 257 // Query strings should attach, or replace existing query string. 258 258 array( '?query=string', 'http://example.com', 'http://example.com/?query=string' ), … … 260 260 array( '?query=string', 'http://example.com/file.ext?existing=query-string', 'http://example.com/file.ext?query=string' ), 261 261 array( 'otherfile.ext?query=string', 'http://example.com/file.ext?existing=query-string', 'http://example.com/otherfile.ext?query=string' ), 262 262 263 263 // A file with a leading dot 264 264 array( '.ext', 'http://example.com/', 'http://example.com/.ext' )
Note: See TracChangeset
for help on using the changeset viewer.