From 932eae0710d227e4ea48efdb4a22a8c631b26b5d Mon Sep 17 00:00:00 2001 From: Rob Date: Thu, 25 Feb 2016 16:10:24 -0500 Subject: [PATCH] Added a couple tests --- unit-tests/RequestTest.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) mode change 100644 => 100755 unit-tests/RequestTest.php diff --git a/unit-tests/RequestTest.php b/unit-tests/RequestTest.php old mode 100644 new mode 100755 index 64ccf8ccec6..91c2007203b --- a/unit-tests/RequestTest.php +++ b/unit-tests/RequestTest.php @@ -200,6 +200,36 @@ public function testGetUploadedFiles() $this->assertEquals($successful[3]->getTempName(), 't3'); } + public function testGetURI() + { + $tmpServer = $_SERVER; + unset($_SERVER); + + $_SERVER['REQUEST_URI'] = '/this/is/a/test'; + + $request = new \Phalcon\Http\Request(); + $uri = $request->getURI(); + + $this->assertEquals('/this/is/a/test', $uri); + + $_SERVER = $tmpServer; + } + + public function testGetHeader() + { + $tmpServer = $_SERVER; + unset($_SERVER); + + $_SERVER['HTTP_X_AUTHORIZATION'] = 'AUTH_TOK3N'; + + $request = new \Phalcon\Http\Request(); + $token = $request->getHeader('X_AUTHORIZATION'); + + $this->assertEquals('AUTH_TOK3N', $token); + + $_SERVER = $tmpServer; + } + public function xtestGetAuth() { $orgServer = $_SERVER;