Skip to content
Permalink
Browse files

Add tests for Uri object being correct.

  • Loading branch information...
markstory committed Sep 13, 2016
1 parent 81fc2f8 commit 1dae2c13947cd226d896eaa889ee7ee7b8cc4463
Showing with 10 additions and 2 deletions.
  1. +10 −2 tests/TestCase/Network/RequestTest.php
@@ -2198,9 +2198,17 @@ public function testEnvironmentDetection($name, $env, $expected)
$this->_loadEnvironment($env);
$request = Request::createFromGlobals();
$this->assertEquals($expected['url'], $request->url, "url error");
$this->assertEquals($expected['base'], $request->base, "base error");
$uri = $request->getUri();
$this->assertEquals($expected['url'], $request->url, "URL is incorrect");
$this->assertEquals('/' . $expected['url'], $uri->getPath(), 'Uri->getPath() is incorrect');
$this->assertEquals($expected['base'], $request->base, "base is incorrect");
$this->assertEquals($expected['base'], $request->getAttribute('base'), "base is incorrect");
$this->assertEquals($expected['webroot'], $request->webroot, "webroot error");
$this->assertEquals($expected['webroot'], $request->getAttribute('webroot'), "webroot is incorrect");
if (isset($expected['urlParams'])) {
$this->assertEquals($expected['urlParams'], $request->query, "GET param mismatch");
}

0 comments on commit 1dae2c1

Please sign in to comment.
You can’t perform that action at this time.