Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5952587
WfAppendQueryTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
WfAppendQueryTest.php
View Options
<?php
/**
* @group GlobalFunctions
* @covers ::wfAppendQuery
*/
class
WfAppendQueryTest
extends
MediaWikiUnitTestCase
{
/**
* @dataProvider provideAppendQuery
*/
public
function
testAppendQuery
(
$url
,
$query
,
$expected
,
$message
=
null
)
{
$this
->
assertEquals
(
$expected
,
wfAppendQuery
(
$url
,
$query
),
$message
);
}
public
static
function
provideAppendQuery
()
{
return
[
[
'http://www.example.org/index.php'
,
''
,
'http://www.example.org/index.php'
,
'No query'
],
[
'http://www.example.org/index.php'
,
[
'foo'
=>
'bar'
],
'http://www.example.org/index.php?foo=bar'
,
'Set query array'
],
[
'http://www.example.org/index.php?foz=baz'
,
'foo=bar'
,
'http://www.example.org/index.php?foz=baz&foo=bar'
,
'Set query string'
],
[
'http://www.example.org/index.php?foo=bar'
,
''
,
'http://www.example.org/index.php?foo=bar'
,
'Empty string with query'
],
[
'http://www.example.org/index.php?foo=bar'
,
[
'baz'
=>
'quux'
],
'http://www.example.org/index.php?foo=bar&baz=quux'
,
'Add query array'
],
[
'http://www.example.org/index.php?foo=bar'
,
'baz=quux'
,
'http://www.example.org/index.php?foo=bar&baz=quux'
,
'Add query string'
],
[
'http://www.example.org/index.php?foo=bar'
,
[
'baz'
=>
'quux'
,
'foo'
=>
'baz'
],
'http://www.example.org/index.php?foo=bar&baz=quux&foo=baz'
,
'Modify query array'
],
[
'http://www.example.org/index.php?foo=bar'
,
'baz=quux&foo=baz'
,
'http://www.example.org/index.php?foo=bar&baz=quux&foo=baz'
,
'Modify query string'
],
[
'http://www.example.org/index.php#baz'
,
'foo=bar'
,
'http://www.example.org/index.php?foo=bar#baz'
,
'URL with fragment'
],
[
'http://www.example.org/index.php?foo=bar#baz'
,
'quux=blah'
,
'http://www.example.org/index.php?foo=bar&quux=blah#baz'
,
'URL with query string and fragment'
]
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 3 2026, 01:35 (4 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
4d/a9/d1d20b2ee1dd043d3928f7486e06
Default Alt Text
WfAppendQueryTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment