Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MINOR Fixed HTTPTest when invoked through dev/tests/all or with GET p…

…arameters (see r98373) (from r98383)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102650 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 804c588215071c571218bce49b887a206a92e366 1 parent 28fd091
@chillu chillu authored
Showing with 7 additions and 4 deletions.
  1. +7 −4 tests/HTTPTest.php
View
11 tests/HTTPTest.php
@@ -47,14 +47,17 @@ public function testGetLinksIn() {
* Tests {@link HTTP::setGetVar()}
*/
public function testSetGetVar() {
- // HACK No easy way to get the current URL without the query string or fragment
- $base = Director::absoluteBaseURL() . 'dev/tests/HTTPTest';
+ $currentURL = Director::absoluteURL($_SERVER['REQUEST_URI']);
+ // Hackery to work around volatile URL formats in test invocation
+ $expected = $currentURL;
+ $expected .= (strpos($currentURL, '?') === FALSE) ? '?' : '&';
+ $expected .= 'foo=bar';
$this->assertEquals(
- $base . '?foo=bar',
+ $expected,
HTTP::setGetVar('foo', 'bar'),
'Omitting a URL falls back to current URL'
- );
+ );
$this->assertEquals(
Director::absoluteBaseURL() . 'relative/url?foo=bar',
Please sign in to comment.
Something went wrong with that request. Please try again.