mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Reorganize ext/uri tests - equivalence (#20391)
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
--TEST--
|
||||
Test URI equality checks
|
||||
--EXTENSIONS--
|
||||
uri
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(new Uri\Rfc3986\Uri("https://example.com")->equals(new Uri\Rfc3986\Uri("https://example.com"))); // true: identical URIs
|
||||
var_dump(new Uri\Rfc3986\Uri("https://example.com#foo")->equals(new Uri\Rfc3986\Uri("https://example.com#bar"), Uri\UriComparisonMode::ExcludeFragment)); // true: fragment differs, but fragment is excluded
|
||||
var_dump(new Uri\Rfc3986\Uri("https://example.com#foo")->equals(new Uri\Rfc3986\Uri("https://example.com#bar"), Uri\UriComparisonMode::IncludeFragment)); // false: fragment differs and fragment is included
|
||||
var_dump(new Uri\Rfc3986\Uri("https://example.com/foo/..")->equals(new Uri\Rfc3986\Uri("https://example.com"))); // false: first URI becomes https://example.com/ after normalization
|
||||
var_dump(new Uri\Rfc3986\Uri("https://example.com/foo/..")->equals(new Uri\Rfc3986\Uri("https://example.com/"))); // true: both URIs are https://example.com/ after normalization
|
||||
var_dump(new Uri\Rfc3986\Uri("http://example%2ecom/foo%2fb%61r")->equals(new Uri\Rfc3986\Uri("http://example%2ecom/foo/bar"))); // false: "/" in the path should not be decoded
|
||||
var_dump(new Uri\Rfc3986\Uri("http://example%2ecom/foo/b%61r")->equals(new Uri\Rfc3986\Uri("http://example%2ecom/foo/bar"))); // true: percent-decoding during normalization gives same URIs
|
||||
|
||||
var_dump(new Uri\WhatWg\Url("https://example.com")->equals(new Uri\WhatWg\Url("https://example.com"))); // true: identical URIs
|
||||
var_dump(new Uri\WhatWg\Url("https://example.com#foo")->equals(new Uri\WhatWg\Url("https://example.com#bar"), Uri\UriComparisonMode::ExcludeFragment)); // true: fragment differs, but fragment is excluded
|
||||
var_dump(new Uri\WhatWg\Url("https://example.com#foo")->equals(new Uri\WhatWg\Url("https://example.com#bar"), Uri\UriComparisonMode::IncludeFragment)); // false: fragment differs and fragment is included
|
||||
var_dump(new Uri\WhatWg\Url("https://example.com/foo/..")->equals(new Uri\WhatWg\Url("https://example.com"))); // true: both URIs are https://example.com/ after normalization
|
||||
var_dump(new Uri\WhatWg\Url("https://example.com/foo/..")->equals(new Uri\WhatWg\Url("https://example.com/"))); // true: both URIs are https://example.com/ after normalization
|
||||
var_dump(new Uri\WhatWg\Url("http://example%2ecom/foo%2fb%61r")->equals(new Uri\WhatWg\Url("http://example%2ecom/foo/bar"))); // false: WHATWG doesn't percent-decode the path during normalization
|
||||
var_dump(new Uri\WhatWg\Url("http://example%2ecom/foo/b%61r")->equals(new Uri\WhatWg\Url("http://example.com/foo/b%61r"))); // true: WHATWG percent-decodes the host during normalization
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
15
ext/uri/tests/rfc3986/equivalence/equals_false_host.phpt
Normal file
15
ext/uri/tests/rfc3986/equivalence/equals_false_host.phpt
Normal file
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Test Uri\Rfc3986\Uri equivalence - returns false - host is different
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$uri1 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
$uri2 = Uri\Rfc3986\Uri::parse("https://user:info@192.168.0.1:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
|
||||
var_dump($uri1->equals($uri2));
|
||||
var_dump($uri2->equals($uri1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
15
ext/uri/tests/rfc3986/equivalence/equals_false_path.phpt
Normal file
15
ext/uri/tests/rfc3986/equivalence/equals_false_path.phpt
Normal file
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Test Uri\Rfc3986\Uri equivalence - returns false - path is different
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$uri1 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
$uri2 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:443/foo/bar/baz?abc=123&def=ghi#hashmark");
|
||||
|
||||
var_dump($uri1->equals($uri2));
|
||||
var_dump($uri2->equals($uri1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
15
ext/uri/tests/rfc3986/equivalence/equals_false_port.phpt
Normal file
15
ext/uri/tests/rfc3986/equivalence/equals_false_port.phpt
Normal file
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Test Uri\Rfc3986\Uri equivalence - returns false - port is different
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$uri1 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
$uri2 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:442/foo/bar?abc=123&def=ghi#hashmark");
|
||||
|
||||
var_dump($uri1->equals($uri2));
|
||||
var_dump($uri2->equals($uri1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
15
ext/uri/tests/rfc3986/equivalence/equals_false_query.phpt
Normal file
15
ext/uri/tests/rfc3986/equivalence/equals_false_query.phpt
Normal file
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Test Uri\Rfc3986\Uri equivalence - returns false - query is different
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$uri1 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
$uri2 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:443/foo/bar?abc=123#hashmark");
|
||||
|
||||
var_dump($uri1->equals($uri2));
|
||||
var_dump($uri2->equals($uri1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
15
ext/uri/tests/rfc3986/equivalence/equals_false_query2.phpt
Normal file
15
ext/uri/tests/rfc3986/equivalence/equals_false_query2.phpt
Normal file
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Test Uri\Rfc3986\Uri equivalence - returns false - query differs in casing
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$uri1 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
$uri2 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:443/foo/bar?ABC=123&def=ghi#hashmark");
|
||||
|
||||
var_dump($uri1->equals($uri2));
|
||||
var_dump($uri2->equals($uri1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
15
ext/uri/tests/rfc3986/equivalence/equals_false_scheme.phpt
Normal file
15
ext/uri/tests/rfc3986/equivalence/equals_false_scheme.phpt
Normal file
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Test Uri\Rfc3986\Uri equivalence - returns false - scheme is different
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$uri1 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
$uri2 = Uri\Rfc3986\Uri::parse("http://user:info@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
|
||||
var_dump($uri1->equals($uri2));
|
||||
var_dump($uri2->equals($uri1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
15
ext/uri/tests/rfc3986/equivalence/equals_false_userinfo.phpt
Normal file
15
ext/uri/tests/rfc3986/equivalence/equals_false_userinfo.phpt
Normal file
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Test Uri\Rfc3986\Uri equivalence - returns false - userinfo is different
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$uri1 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
$uri2 = Uri\Rfc3986\Uri::parse("https://user@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
|
||||
var_dump($uri1->equals($uri2));
|
||||
var_dump($uri2->equals($uri1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Test Uri\Rfc3986\Uri equivalence - different fragment - include fragment variation
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$uri1 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
$uri2 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hash");
|
||||
|
||||
var_dump($uri1->equals($uri2, Uri\UriComparisonMode::IncludeFragment));
|
||||
var_dump($uri2->equals($uri1, Uri\UriComparisonMode::IncludeFragment));
|
||||
|
||||
var_dump($uri1->equals($uri2, Uri\UriComparisonMode::ExcludeFragment));
|
||||
var_dump($uri2->equals($uri1, Uri\UriComparisonMode::ExcludeFragment));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
20
ext/uri/tests/rfc3986/equivalence/equals_true_identical.phpt
Normal file
20
ext/uri/tests/rfc3986/equivalence/equals_true_identical.phpt
Normal file
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Test Uri\Rfc3986\Uri equivalence - returns true - identical URIs
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$uri1 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
$uri2 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
|
||||
var_dump($uri1->equals($uri2, Uri\UriComparisonMode::IncludeFragment));
|
||||
var_dump($uri2->equals($uri1, Uri\UriComparisonMode::IncludeFragment));
|
||||
|
||||
var_dump($uri1->equals($uri2, Uri\UriComparisonMode::ExcludeFragment));
|
||||
var_dump($uri2->equals($uri1, Uri\UriComparisonMode::ExcludeFragment));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Test Uri\Rfc3986\Uri equivalence - returns true - after multiple normalization steps
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$uri1 = Uri\Rfc3986\Uri::parse("https://user:info@example%2ecom:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
$uri2 = Uri\Rfc3986\Uri::parse("HTTPS://user:info@EXAMPLE.COM:0443/../foo/b%61r?abc=123&def=ghi#hashmark");
|
||||
|
||||
var_dump($uri1->equals($uri2));
|
||||
var_dump($uri2->equals($uri1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Test Uri\Rfc3986\Uri equivalence - returns true - after IPv6 normalization
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$uri1 = new Uri\Rfc3986\Uri("https://[2001:0db8:0001:0000:0000:0ab9:C0A8:0102]");
|
||||
$uri2 = new Uri\Rfc3986\Uri("https://[2001:DB8:1::AB9:C0A8:102]");
|
||||
|
||||
var_dump($uri1->equals($uri2));
|
||||
var_dump($uri2->equals($uri1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
15
ext/uri/tests/whatwg/equivalence/equals_false_host.phpt
Normal file
15
ext/uri/tests/whatwg/equivalence/equals_false_host.phpt
Normal file
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Test Uri\WhatWg\Url equivalence - returns false - host is different
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$url1 = Uri\WhatWg\Url::parse("https://user:pass@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
$url2 = Uri\WhatWg\Url::parse("https://user:pass@192.168.0.1:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
|
||||
var_dump($url1->equals($url2));
|
||||
var_dump($url2->equals($url1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
15
ext/uri/tests/whatwg/equivalence/equals_false_password.phpt
Normal file
15
ext/uri/tests/whatwg/equivalence/equals_false_password.phpt
Normal file
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Test Uri\WhatWg\Url equivalence - returns false - password is different
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$url1 = Uri\WhatWg\Url::parse("https://user:pass@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
$url2 = Uri\WhatWg\Url::parse("https://user:@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
|
||||
var_dump($url1->equals($url2));
|
||||
var_dump($url2->equals($url1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
15
ext/uri/tests/whatwg/equivalence/equals_false_path.phpt
Normal file
15
ext/uri/tests/whatwg/equivalence/equals_false_path.phpt
Normal file
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Test Uri\WhatWg\Url equivalence - returns false - path is different
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$url1 = Uri\WhatWg\Url::parse("https://user:pass@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
$url2 = Uri\WhatWg\Url::parse("https://user:pass@example.com:443/foo/bar/baz?abc=123&def=ghi#hashmark");
|
||||
|
||||
var_dump($url1->equals($url2));
|
||||
var_dump($url2->equals($url1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Test Uri\WhatWg\Url equivalence - returns false - path is not percent-decoded during normalization
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$url1 = new Uri\WhatWg\Url("https://example.com/foo/bar");
|
||||
$url2 = new Uri\WhatWg\Url("https://example.com/foo/b%61r");
|
||||
|
||||
var_dump($url1->equals($url2));
|
||||
var_dump($url2->equals($url1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
15
ext/uri/tests/whatwg/equivalence/equals_false_port.phpt
Normal file
15
ext/uri/tests/whatwg/equivalence/equals_false_port.phpt
Normal file
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Test Uri\WhatWg\Url equivalence - returns false - port is different
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$url1 = Uri\WhatWg\Url::parse("https://user:pass@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
$url2 = Uri\WhatWg\Url::parse("https://user:pass@example.com:442/foo/bar?abc=123&def=ghi#hashmark");
|
||||
|
||||
var_dump($url1->equals($url2));
|
||||
var_dump($url2->equals($url1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
15
ext/uri/tests/whatwg/equivalence/equals_false_query.phpt
Normal file
15
ext/uri/tests/whatwg/equivalence/equals_false_query.phpt
Normal file
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Test Uri\WhatWg\Url equivalence - returns false - query is different
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$url1 = Uri\WhatWg\Url::parse("https://user:pass@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
$url2 = Uri\WhatWg\Url::parse("https://user:pass@example.com:443/foo/bar?abc=123#hashmark");
|
||||
|
||||
var_dump($url1->equals($url2));
|
||||
var_dump($url2->equals($url1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
15
ext/uri/tests/whatwg/equivalence/equals_false_query2.phpt
Normal file
15
ext/uri/tests/whatwg/equivalence/equals_false_query2.phpt
Normal file
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Test Uri\WhatWg\Url equivalence - returns false - query differs in casing
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$url1 = Uri\WhatWg\Url::parse("https://user:pass@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
$url2 = Uri\WhatWg\Url::parse("https://user:pass@example.com:443/foo/bar?ABC=123&def=ghi#hashmark");
|
||||
|
||||
var_dump($url1->equals($url2));
|
||||
var_dump($url2->equals($url1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
15
ext/uri/tests/whatwg/equivalence/equals_false_user.phpt
Normal file
15
ext/uri/tests/whatwg/equivalence/equals_false_user.phpt
Normal file
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Test Uri\WhatWg\Url equivalence - returns false - user is different
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$url1 = Uri\WhatWg\Url::parse("https://user:pass@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
$url2 = Uri\WhatWg\Url::parse("https://usr:pass@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
|
||||
var_dump($url1->equals($url2));
|
||||
var_dump($url2->equals($url1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Test Uri\WhatWg\Url equivalence - different fragment - include fragment variation
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$url1 = Uri\WhatWg\Url::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
$url2 = Uri\WhatWg\Url::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hash");
|
||||
|
||||
var_dump($url1->equals($url2, Uri\UriComparisonMode::IncludeFragment));
|
||||
var_dump($url2->equals($url1, Uri\UriComparisonMode::IncludeFragment));
|
||||
|
||||
var_dump($url1->equals($url2, Uri\UriComparisonMode::ExcludeFragment));
|
||||
var_dump($url2->equals($url1, Uri\UriComparisonMode::ExcludeFragment));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(true)
|
||||
20
ext/uri/tests/whatwg/equivalence/equals_true_identical.phpt
Normal file
20
ext/uri/tests/whatwg/equivalence/equals_true_identical.phpt
Normal file
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Test Uri\WhatWg\Url equivalence - returns true - identical URIs
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$url1 = Uri\WhatWg\Url::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
$url2 = Uri\WhatWg\Url::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
|
||||
var_dump($url1->equals($url2, Uri\UriComparisonMode::IncludeFragment));
|
||||
var_dump($url2->equals($url1, Uri\UriComparisonMode::IncludeFragment));
|
||||
|
||||
var_dump($url1->equals($url2, Uri\UriComparisonMode::ExcludeFragment));
|
||||
var_dump($url2->equals($url1, Uri\UriComparisonMode::ExcludeFragment));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Test Uri\WhatWg\Url equivalence - returns true - after multiple normalization steps
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$url1 = Uri\WhatWg\Url::parse("https://user:info@example%2ecom:0443/foo/bar?abc=123&def=ghi#hashmark");
|
||||
$url2 = Uri\WhatWg\Url::parse("HTTPS://user:info@EXAMPLE.COM:443/../foo/bar?abc=123&def=ghi#hashmark");
|
||||
|
||||
var_dump($url1->equals($url2));
|
||||
var_dump($url2->equals($url1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Test Uri\WhatWg\Url equivalence - returns true - after IPv6 normalization
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$url1 = new Uri\WhatWg\Url("https://[2001:0db8:0001:0000:0000:0ab9:C0A8:0102]");
|
||||
$url2 = new Uri\WhatWg\Url("https://[2001:DB8:1::AB9:C0A8:102]");
|
||||
|
||||
var_dump($url1->equals($url2));
|
||||
var_dump($url2->equals($url1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Test Uri\WhatWg\Url equivalence - returns true - after empty path normalization
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$url1 = new Uri\WhatWg\Url("https://example.com");
|
||||
$url2 = new Uri\WhatWg\Url("https://example.com/");
|
||||
|
||||
var_dump($url1->equals($url2));
|
||||
var_dump($url2->equals($url1));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
Reference in New Issue
Block a user