Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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_all1.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - returns false - all components
--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_all2.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - returns false - all components
--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)
15 changes: 15 additions & 0 deletions ext/uri/tests/rfc3986/equivalence/equals_false_all3.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - returns false - all components
--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://[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_all4.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - returns false - all components
--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_all5.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - returns false - all components
--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_all6.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - returns false - all components
--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_all7.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - returns false - all components
--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_all8.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - returns false - all components
--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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - returns false - fragment excluded
--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::ExcludeFragment));
var_dump($uri2->equals($uri1, Uri\UriComparisonMode::ExcludeFragment));

?>
--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 false - fragment included
--FILE--
<?php

$uri1 = Uri\Rfc3986\Uri::parse("https://user:[email protected]:443/foo/bar/baz?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));

?>
--EXPECT--
bool(false)
bool(false)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - returns true - fragment excluded
--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::ExcludeFragment));
var_dump($uri2->equals($uri1, Uri\UriComparisonMode::ExcludeFragment));

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

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

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

?>
--EXPECT--
bool(true)
bool(true)
15 changes: 15 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,15 @@
--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));
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 - fragment included
--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));

?>
--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 multiple normalization steps
--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(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/rfc3986/equivalence/equals_true_normalization3.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - returns true - after port normalization
--FILE--
<?php

$uri1 = new Uri\Rfc3986\Uri("https://example.com:443");
$uri2 = new Uri\Rfc3986\Uri("https://example.com:0443");

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

?>
--EXPECT--
bool(true)
bool(true)
15 changes: 15 additions & 0 deletions ext/uri/tests/rfc3986/equivalence/equals_true_normalization4.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - returns true - after percent-encoding normalization
--FILE--
<?php

$uri1 = new Uri\Rfc3986\Uri("https://example.com/foo/bar");
$uri2 = new Uri\Rfc3986\Uri("https://example.com/foo/b%61r");

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

?>
--EXPECT--
bool(true)
bool(true)
15 changes: 15 additions & 0 deletions ext/uri/tests/rfc3986/equivalence/equals_true_normalization5.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\Rfc3986\Uri equivalence - returns true - host is percent-decoded during normalization
--FILE--
<?php

$uri1 = new Uri\Rfc3986\Uri("https://example%2ecom/foo/bar");
$uri2 = new Uri\Rfc3986\Uri("https://example.com/foo/bar");

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_all1.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\WhatWg\Url equivalence - returns false - all components
--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)
15 changes: 15 additions & 0 deletions ext/uri/tests/whatwg/equivalence/equals_false_all2.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\WhatWg\Url equivalence - returns false - all components
--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://[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_all3.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Test Uri\WhatWg\Url equivalence - returns false - all components
--FILE--
<?php

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