Changeset 53574
- Timestamp:
- 06/24/2022 03:07:40 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/escUrl.php
r53562 r53574 51 51 /** 52 52 * @covers ::esc_url 53 * @covers :: esc_url_raw53 * @covers ::sanitize_url 54 54 */ 55 55 public function test_all_url_parts() { … … 69 69 parse_url( $url ) 70 70 ); 71 $this->assertSame( 'https://user:pass@host.example.com:1234/path;p=1?query=2&r%5B%5D=3#fragment', esc_url_raw( $url ) );71 $this->assertSame( 'https://user:pass@host.example.com:1234/path;p=1?query=2&r%5B%5D=3#fragment', sanitize_url( $url ) ); 72 72 $this->assertSame( 'https://user:pass@host.example.com:1234/path;p=1?query=2&r%5B%5D=3#fragment', esc_url( $url ) ); 73 73 } … … 86 86 /** 87 87 * @covers ::esc_url 88 * @covers :: esc_url_raw88 * @covers ::sanitize_url 89 89 */ 90 90 public function test_encoding() { 91 $this->assertSame( 'http://example.com?foo=1&bar=2', esc_url_raw( 'http://example.com?foo=1&bar=2' ) );92 $this->assertSame( 'http://example.com?foo=1&bar=2', esc_url_raw( 'http://example.com?foo=1&bar=2' ) );93 $this->assertSame( 'http://example.com?foo=1&bar=2', esc_url_raw( 'http://example.com?foo=1&bar=2' ) );91 $this->assertSame( 'http://example.com?foo=1&bar=2', sanitize_url( 'http://example.com?foo=1&bar=2' ) ); 92 $this->assertSame( 'http://example.com?foo=1&bar=2', sanitize_url( 'http://example.com?foo=1&bar=2' ) ); 93 $this->assertSame( 'http://example.com?foo=1&bar=2', sanitize_url( 'http://example.com?foo=1&bar=2' ) ); 94 94 95 95 $this->assertSame( 'http://example.com?foo=1&bar=2', esc_url( 'http://example.com?foo=1&bar=2' ) ); … … 225 225 * Courtesy of http://blog.lunatech.com/2009/02/03/what-every-web-developer-must-know-about-url-encoding 226 226 * 227 * @covers :: esc_url_raw227 * @covers ::sanitize_url 228 228 */ 229 229 public function test_reserved_characters() { 230 230 $url = "http://example.com/:@-._~!$&'()*+,=;:@-._~!$&'()*+,=:@-._~!$&'()*+,==?/?:@-._~!$%27()*+,;=/?:@-._~!$%27()*+,;==#/?:@-._~!$&'()*+,;="; 231 $this->assertSame( $url, esc_url_raw( $url ) );231 $this->assertSame( $url, sanitize_url( $url ) ); 232 232 } 233 233 … … 291 291 * @ticket 28015 292 292 * 293 * @covers :: esc_url_raw293 * @covers ::sanitize_url 294 294 */ 295 295 public function test_invalid_charaters() { 296 $this->assertEmpty( esc_url_raw( '"^<>{}`' ) );296 $this->assertEmpty( sanitize_url( '"^<>{}`' ) ); 297 297 } 298 298
Note: See TracChangeset
for help on using the changeset viewer.