Skip to content

Commit

Permalink
Added a couple tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rkeplin committed Feb 25, 2016
1 parent 3c144c2 commit 932eae0
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions unit-tests/RequestTest.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 932eae0

Please sign in to comment.