You appear to be a bot. Output may be restricted
Description
Usage
Tests_HTTP_HTTP::parse_url_component_testcases();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/http/http.php
Lines:
1 to 51 of 51
public function parse_url_component_testcases() { // 0: The URL, 1: The requested component, 2: The expected resulting structure. return array( array( self::FULL_TEST_URL, PHP_URL_SCHEME, 'http' ), array( self::FULL_TEST_URL, PHP_URL_USER, 'username' ), array( self::FULL_TEST_URL, PHP_URL_PASS, 'password' ), array( self::FULL_TEST_URL, PHP_URL_HOST, 'host.name' ), array( self::FULL_TEST_URL, PHP_URL_PORT, 9090 ), array( self::FULL_TEST_URL, PHP_URL_PATH, '/path' ), array( self::FULL_TEST_URL, PHP_URL_QUERY, 'arg1=value1&arg2=value2' ), array( self::FULL_TEST_URL, PHP_URL_FRAGMENT, 'anchor' ), // < PHP 5.4.7: Schemeless URL. array( '//example.com/path/', PHP_URL_HOST, 'example.com' ), array( '//example.com/path/', PHP_URL_PATH, '/path/' ), array( '//example.com/', PHP_URL_HOST, 'example.com' ), array( '//example.com/', PHP_URL_PATH, '/' ), array( 'http://example.com//path/', PHP_URL_HOST, 'example.com' ), array( 'http://example.com//path/', PHP_URL_PATH, '//path/' ), // < PHP 5.4.7: Scheme separator in the URL. array( 'http://example.com/http://example.net/', PHP_URL_HOST, 'example.com' ), array( 'http://example.com/http://example.net/', PHP_URL_PATH, '/http://example.net/' ), array( '/path/http://example.net/', PHP_URL_HOST, null ), array( '/path/http://example.net/', PHP_URL_PATH, '/path/http://example.net/' ), // < PHP 5.4.7: IPv6 literals in schemeless URLs are handled incorrectly. array( '//[::FFFF::127.0.0.1]/', PHP_URL_HOST, '[::FFFF::127.0.0.1]' ), array( '//[::FFFF::127.0.0.1]/', PHP_URL_PATH, '/' ), // PHP's parse_url() calls this an invalid URL, we handle it as a path. array( '/://example.com/', PHP_URL_PATH, '/://example.com/' ), // Schemeless URL containing colons cause parse errors in PHP 7+. array( '//fonts.googleapis.com/css?family=Open+Sans:400&subset=latin', PHP_URL_HOST, 'fonts.googleapis.com' ), array( '//fonts.googleapis.com/css?family=Open+Sans:400&subset=latin', PHP_URL_PORT, null ), array( '//fonts.googleapis.com/css?family=Open+Sans:400&subset=latin', PHP_URL_PATH, '/css' ), array( '//fonts.googleapis.com/css?family=Open+Sans:400&subset=latin', PHP_URL_QUERY, 'family=Open+Sans:400&subset=latin' ), array( '//fonts.googleapis.com/css?family=Open+Sans:400', PHP_URL_HOST, 'fonts.googleapis.com' ), // 25 array( '//fonts.googleapis.com/css?family=Open+Sans:400', PHP_URL_PORT, null ), array( '//fonts.googleapis.com/css?family=Open+Sans:400', PHP_URL_PATH, '/css' ), // 27 array( '//fonts.googleapis.com/css?family=Open+Sans:400', PHP_URL_QUERY, 'family=Open+Sans:400' ), // 28 // Empty string or non-string passed in. array( '', PHP_URL_PATH, '' ), array( '', PHP_URL_QUERY, null ), array( 123, PHP_URL_PORT, null ), array( 123, PHP_URL_PATH, '123' ), ); }