Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions ext/uri/tests/036.phpt

This file was deleted.

15 changes: 15 additions & 0 deletions ext/uri/tests/rfc3986/equivalence/equals_false_host.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - returns false - host is different
--FILE--
<?php

$uri1 = Uri\Rfc3986\Uri::parse("https://user:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");
$uri2 = Uri\Rfc3986\Uri::parse("https://user:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");

var_dump($uri1->equals($uri2));
var_dump($uri2->equals($uri1));

?>
--EXPECT--
bool(false)
bool(false)
15 changes: 15 additions & 0 deletions ext/uri/tests/rfc3986/equivalence/equals_false_path.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - returns false - path is different
--FILE--
<?php

$uri1 = Uri\Rfc3986\Uri::parse("https://user:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");
$uri2 = Uri\Rfc3986\Uri::parse("https://user:[email protected]: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 changes: 15 additions & 0 deletions ext/uri/tests/rfc3986/equivalence/equals_false_port.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - returns false - port is different
--FILE--
<?php

$uri1 = Uri\Rfc3986\Uri::parse("https://user:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");
$uri2 = Uri\Rfc3986\Uri::parse("https://user:[email protected]:442/foo/bar?abc=123&def=ghi#hashmark");

var_dump($uri1->equals($uri2));
var_dump($uri2->equals($uri1));

?>
--EXPECT--
bool(false)
bool(false)
15 changes: 15 additions & 0 deletions ext/uri/tests/rfc3986/equivalence/equals_false_query.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - returns false - query is different
--FILE--
<?php

$uri1 = Uri\Rfc3986\Uri::parse("https://user:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");
$uri2 = Uri\Rfc3986\Uri::parse("https://user:[email protected]:443/foo/bar?abc=123#hashmark");

var_dump($uri1->equals($uri2));
var_dump($uri2->equals($uri1));

?>
--EXPECT--
bool(false)
bool(false)
15 changes: 15 additions & 0 deletions ext/uri/tests/rfc3986/equivalence/equals_false_query2.phpt
Original file line number Diff line number Diff line change
@@ -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:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");
$uri2 = Uri\Rfc3986\Uri::parse("https://user:[email protected]:443/foo/bar?ABC=123&def=ghi#hashmark");

var_dump($uri1->equals($uri2));
var_dump($uri2->equals($uri1));

?>
--EXPECT--
bool(false)
bool(false)
15 changes: 15 additions & 0 deletions ext/uri/tests/rfc3986/equivalence/equals_false_scheme.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - returns false - scheme is different
--FILE--
<?php

$uri1 = Uri\Rfc3986\Uri::parse("https://user:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");
$uri2 = Uri\Rfc3986\Uri::parse("http://user:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");

var_dump($uri1->equals($uri2));
var_dump($uri2->equals($uri1));

?>
--EXPECT--
bool(false)
bool(false)
15 changes: 15 additions & 0 deletions ext/uri/tests/rfc3986/equivalence/equals_false_userinfo.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - returns false - userinfo is different
--FILE--
<?php

$uri1 = Uri\Rfc3986\Uri::parse("https://user:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");
$uri2 = Uri\Rfc3986\Uri::parse("https://[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");

var_dump($uri1->equals($uri2));
var_dump($uri2->equals($uri1));

?>
--EXPECT--
bool(false)
bool(false)
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - different fragment - include fragment variation
--FILE--
<?php

$uri1 = Uri\Rfc3986\Uri::parse("https://user:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");
$uri2 = Uri\Rfc3986\Uri::parse("https://user:[email protected]: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 changes: 20 additions & 0 deletions ext/uri/tests/rfc3986/equivalence/equals_true_identical.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - returns true - identical URIs
--FILE--
<?php

$uri1 = Uri\Rfc3986\Uri::parse("https://user:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");
$uri2 = Uri\Rfc3986\Uri::parse("https://user:[email protected]: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)
Original file line number Diff line number Diff line change
@@ -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:[email protected]:0443/../foo/b%61r?abc=123&def=ghi#hashmark");

var_dump($uri1->equals($uri2));
var_dump($uri2->equals($uri1));

?>
--EXPECT--
bool(true)
bool(true)
Original file line number Diff line number Diff line change
@@ -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 changes: 15 additions & 0 deletions ext/uri/tests/whatwg/equivalence/equals_false_host.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\WhatWg\Url equivalence - returns false - host is different
--FILE--
<?php

$url1 = Uri\WhatWg\Url::parse("https://user:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");
$url2 = Uri\WhatWg\Url::parse("https://user:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");

var_dump($url1->equals($url2));
var_dump($url2->equals($url1));

?>
--EXPECT--
bool(false)
bool(false)
15 changes: 15 additions & 0 deletions ext/uri/tests/whatwg/equivalence/equals_false_password.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\WhatWg\Url equivalence - returns false - password is different
--FILE--
<?php

$url1 = Uri\WhatWg\Url::parse("https://user:[email protected]: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 changes: 15 additions & 0 deletions ext/uri/tests/whatwg/equivalence/equals_false_path.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\WhatWg\Url equivalence - returns false - path is different
--FILE--
<?php

$url1 = Uri\WhatWg\Url::parse("https://user:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");
$url2 = Uri\WhatWg\Url::parse("https://user:[email protected]:443/foo/bar/baz?abc=123&def=ghi#hashmark");

var_dump($url1->equals($url2));
var_dump($url2->equals($url1));

?>
--EXPECT--
bool(false)
bool(false)
Original file line number Diff line number Diff line change
@@ -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 changes: 15 additions & 0 deletions ext/uri/tests/whatwg/equivalence/equals_false_port.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\WhatWg\Url equivalence - returns false - port is different
--FILE--
<?php

$url1 = Uri\WhatWg\Url::parse("https://user:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");
$url2 = Uri\WhatWg\Url::parse("https://user:[email protected]:442/foo/bar?abc=123&def=ghi#hashmark");

var_dump($url1->equals($url2));
var_dump($url2->equals($url1));

?>
--EXPECT--
bool(false)
bool(false)
15 changes: 15 additions & 0 deletions ext/uri/tests/whatwg/equivalence/equals_false_query.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\WhatWg\Url equivalence - returns false - query is different
--FILE--
<?php

$url1 = Uri\WhatWg\Url::parse("https://user:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");
$url2 = Uri\WhatWg\Url::parse("https://user:[email protected]:443/foo/bar?abc=123#hashmark");

var_dump($url1->equals($url2));
var_dump($url2->equals($url1));

?>
--EXPECT--
bool(false)
bool(false)
15 changes: 15 additions & 0 deletions ext/uri/tests/whatwg/equivalence/equals_false_query2.phpt
Original file line number Diff line number Diff line change
@@ -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:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");
$url2 = Uri\WhatWg\Url::parse("https://user:[email protected]:443/foo/bar?ABC=123&def=ghi#hashmark");

var_dump($url1->equals($url2));
var_dump($url2->equals($url1));

?>
--EXPECT--
bool(false)
bool(false)
15 changes: 15 additions & 0 deletions ext/uri/tests/whatwg/equivalence/equals_false_user.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\WhatWg\Url equivalence - returns false - user is different
--FILE--
<?php

$url1 = Uri\WhatWg\Url::parse("https://user:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");
$url2 = Uri\WhatWg\Url::parse("https://usr:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");

var_dump($url1->equals($url2));
var_dump($url2->equals($url1));

?>
--EXPECT--
bool(false)
bool(false)
20 changes: 20 additions & 0 deletions ext/uri/tests/whatwg/equivalence/equals_fragment_different.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--TEST--
Test Uri\WhatWg\Url equivalence - different fragment - include fragment variation
--FILE--
<?php

$url1 = Uri\WhatWg\Url::parse("https://user:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");
$url2 = Uri\WhatWg\Url::parse("https://user:[email protected]: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 changes: 20 additions & 0 deletions ext/uri/tests/whatwg/equivalence/equals_true_identical.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--TEST--
Test Uri\WhatWg\Url equivalence - returns true - identical URIs
--FILE--
<?php

$url1 = Uri\WhatWg\Url::parse("https://user:[email protected]:443/foo/bar?abc=123&def=ghi#hashmark");
$url2 = Uri\WhatWg\Url::parse("https://user:[email protected]: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)
Loading
Loading