Skip to content

Commit 12e2a8d

Browse files
authored
Merge pull request #6567 from kenjis/test-SiteUrlTest
test: add test cases in SiteUrlTest
2 parents 7959a37 + a8566c3 commit 12e2a8d

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

tests/system/Helpers/URLHelper/SiteUrlTest.php

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,16 @@ public function testUrls($baseURL, $indexPage, $scheme, $secure, $path, $expecte
7777

7878
public function configProvider()
7979
{
80-
// baseURL, indexPage, scheme, path, expectedSiteUrl
80+
// baseURL, indexPage, scheme, secure, path, expectedSiteUrl
8181
return [
82+
'forceGlobalSecure' => [
83+
'http://example.com/',
84+
'index.php',
85+
null,
86+
true,
87+
'',
88+
'https://example.com/index.php',
89+
],
8290
[
8391
'http://example.com/',
8492
'index.php',
@@ -119,6 +127,22 @@ public function configProvider()
119127
'abc',
120128
'http://example.com/abc',
121129
],
130+
'URL decode' => [
131+
'http://example.com/',
132+
'',
133+
null,
134+
false,
135+
'template/meet-%26-greet',
136+
'http://example.com/template/meet-&-greet',
137+
],
138+
'URL encode' => [
139+
'http://example.com/',
140+
'',
141+
null,
142+
false,
143+
'<s>alert</s>',
144+
'http://example.com/%3Cs%3Ealert%3C/s%3E',
145+
],
122146
[
123147
'http://example.com/public/',
124148
'index.php',

0 commit comments

Comments
 (0)