mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Fixed HTTPTest->testSetGetVar()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98407 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
5ae6f3b9e4
commit
4b6330b0e1
@ -47,14 +47,15 @@ class HTTPTest extends SapphireTest {
|
|||||||
* Tests {@link HTTP::setGetVar()}
|
* Tests {@link HTTP::setGetVar()}
|
||||||
*/
|
*/
|
||||||
public function testSetGetVar() {
|
public function testSetGetVar() {
|
||||||
$currentURL = Director::absoluteURL($_SERVER['REQUEST_URI']);
|
|
||||||
|
|
||||||
// Hackery to work around volatile URL formats in test invocation
|
// Hackery to work around volatile URL formats in test invocation
|
||||||
$expected = $currentURL;
|
$expectedPath = preg_replace('/\?.*/', '', $_SERVER['REQUEST_URI']);
|
||||||
$expected .= (strpos($currentURL, '?') === FALSE) ? '?' : '&';
|
$this->assertContains(
|
||||||
$expected .= 'foo=bar';
|
$expectedPath,
|
||||||
$this->assertEquals(
|
HTTP::setGetVar('foo', 'bar'),
|
||||||
$expected,
|
'Omitting a URL falls back to current URL'
|
||||||
|
);
|
||||||
|
$this->assertContains(
|
||||||
|
'foo=bar',
|
||||||
HTTP::setGetVar('foo', 'bar'),
|
HTTP::setGetVar('foo', 'bar'),
|
||||||
'Omitting a URL falls back to current URL'
|
'Omitting a URL falls back to current URL'
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user