Changeset 35369 for trunk/tests/phpunit/tests/http/http.php
- Timestamp:
- 10/23/2015 05:53:05 AM (10 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/http/http.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/http/http.php
r34123 r35369 71 71 * @dataProvider parse_url_testcases 72 72 */ 73 function test_parse_url( $url, $expected ) { 74 if ( ! is_callable( array( 'WP_HTTP_Testable', 'parse_url' ) ) ) { 75 $this->markTestSkipped( "This version of WP_HTTP doesn't support WP_HTTP::parse_url()" ); 76 return; 77 } 78 $actual = WP_HTTP_Testable::parse_url( $url ); 73 function test_wp_parse_url( $url, $expected ) { 74 $actual = wp_parse_url( $url ); 79 75 $this->assertEquals( $expected, $actual ); 80 76 } … … 93 89 array( 'http://example.com/http://example.net/', array( 'scheme' => 'http', 'host' => 'example.com', 'path' => '/http://example.net/' ) ), 94 90 array( '/path/http://example.net/', array( 'path' => '/path/http://example.net/' ) ), 91 92 // < PHP 5.4.7: IPv6 literals in schemeless URLs are handled incorrectly. 93 array( '//[::FFFF::127.0.0.1]/', array( 'host' => '[::FFFF::127.0.0.1]', 'path' => '/' ) ), 94 95 95 // PHP's parse_url() calls this an invalid url, we handle it as a path 96 96 array( '/://example.com/', array( 'path' => '/://example.com/' ) ), … … 104 104 } 105 105 } 106 107 /**108 * A Wrapper of WP_Http to make parse_url() publicaly accessible for testing purposes.109 */110 class WP_HTTP_Testable extends WP_Http {111 public static function parse_url( $url ) {112 return parent::parse_url( $url );113 }114 }
Note: See TracChangeset
for help on using the changeset viewer.