Skip to content

Commit b5166d3

Browse files
committed
Adjust tests according to cod review
1 parent 308f943 commit b5166d3

15 files changed

+43
-88
lines changed

ext/uri/tests/rfc3986/equivalence/equals_false_exclude_fragment.phpt renamed to ext/uri/tests/rfc3986/equivalence/equals_false_exclude_fragment1.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ Test Uri\Rfc3986\Uri equivalence - returns false - fragment excluded
44
<?php
55

66
$uri1 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
7-
$uri2 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hash");
7+
$uri2 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:443/foo/bar/?abc=123&def=ghi#hash");
88

99
var_dump($uri1->equals($uri2, Uri\UriComparisonMode::ExcludeFragment));
1010
var_dump($uri2->equals($uri1, Uri\UriComparisonMode::ExcludeFragment));
1111

1212
?>
1313
--EXPECT--
14-
bool(true)
15-
bool(true)
14+
bool(false)
15+
bool(false)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
Test Uri\Rfc3986\Uri equivalence - returns false - fragment included
3+
--FILE--
4+
<?php
5+
6+
$uri1 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
7+
$uri2 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hash");
8+
9+
var_dump($uri1->equals($uri2, Uri\UriComparisonMode::IncludeFragment));
10+
var_dump($uri2->equals($uri1, Uri\UriComparisonMode::IncludeFragment));
11+
12+
?>
13+
--EXPECT--
14+
bool(false)
15+
bool(false)

ext/uri/tests/rfc3986/equivalence/equals_false_include_fragment.phpt renamed to ext/uri/tests/rfc3986/equivalence/equals_false_include_fragment2.phpt

File renamed without changes.

ext/uri/tests/rfc3986/equivalence/equals_true_normalization1.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Test Uri\Rfc3986\Uri equivalence - returns true - after multiple normalization s
33
--FILE--
44
<?php
55

6-
$uri1 = Uri\Rfc3986\Uri::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
7-
$uri2 = Uri\Rfc3986\Uri::parse("HTTPS://user:info@EXAMPLE.COM:443/../foo/bar?abc=123&def=ghi#hashmark");
6+
$uri1 = Uri\Rfc3986\Uri::parse("https://user:info@example%2ecom:443/foo/bar?abc=123&def=ghi#hashmark");
7+
$uri2 = Uri\Rfc3986\Uri::parse("HTTPS://user:info@EXAMPLE.COM:0443/../foo/b%61r?abc=123&def=ghi#hashmark");
88

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

ext/uri/tests/rfc3986/equivalence/equals_true_normalization3.phpt

Lines changed: 0 additions & 15 deletions
This file was deleted.

ext/uri/tests/rfc3986/equivalence/equals_true_normalization4.phpt

Lines changed: 0 additions & 15 deletions
This file was deleted.

ext/uri/tests/rfc3986/equivalence/equals_true_normalization5.phpt

Lines changed: 0 additions & 15 deletions
This file was deleted.

ext/uri/tests/whatwg/equivalence/equals_false_exclude_fragment.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ Test Uri\WhatWg\Url equivalence - returns false - fragment excluded
44
<?php
55

66
$url1 = Uri\WhatWg\Url::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
7-
$url2 = Uri\WhatWg\Url::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hash");
7+
$url2 = Uri\WhatWg\Url::parse("https://user:info@example.com:443/foo/bar/?abc=123&def=ghi#hashmark");
88

99
var_dump($url1->equals($url2, Uri\UriComparisonMode::ExcludeFragment));
1010
var_dump($url2->equals($url1, Uri\UriComparisonMode::ExcludeFragment));
1111

1212
?>
1313
--EXPECT--
14-
bool(true)
15-
bool(true)
14+
bool(false)
15+
bool(false)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
Test Uri\WhatWg\Url equivalence - returns false - fragment included
3+
--FILE--
4+
<?php
5+
6+
$url1 = Uri\WhatWg\Url::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hashmark");
7+
$url2 = Uri\WhatWg\Url::parse("https://user:info@example.com:443/foo/bar?abc=123&def=ghi#hash");
8+
9+
var_dump($url1->equals($url2, Uri\UriComparisonMode::IncludeFragment));
10+
var_dump($url2->equals($url1, Uri\UriComparisonMode::IncludeFragment));
11+
12+
?>
13+
--EXPECT--
14+
bool(false)
15+
bool(false)

ext/uri/tests/whatwg/equivalence/equals_false_include_fragment.phpt renamed to ext/uri/tests/whatwg/equivalence/equals_false_include_fragment2.phpt

File renamed without changes.

0 commit comments

Comments
 (0)