Test for getExtension()

This commit is contained in:
Ben Speakman 2016-01-28 14:55:48 +00:00 committed by Sam Minnée
parent 705d342080
commit 27bca14f86

View File

@ -253,6 +253,12 @@ class HTTPRequestTest extends SapphireTest {
$req = new SS_HTTPRequest('GET', '/home?test=1'); $req = new SS_HTTPRequest('GET', '/home?test=1');
$this->assertEquals('home?test=1', $req->getURL(true)); $this->assertEquals('home?test=1', $req->getURL(true));
$this->assertEquals('home', $req->getURL()); $this->assertEquals('home', $req->getURL());
$req = new SS_HTTPRequest('GET', 'somefile.gif');
$this->assertEquals('gif', $req->getExtension());
$req = new SS_HTTPRequest('GET', '.passwd');
$this->assertEquals(null, $req->getExtension());
} }
public function testGetIPFromHeaderValue() { public function testGetIPFromHeaderValue() {