Skip to content
Permalink
Browse files

Adding CakeRequest and CakeResponse to the routing group.

Making more tests not fail in cli.
  • Loading branch information...
markstory committed Sep 20, 2010
1 parent 0a1bc06 commit 53086635b3ead8b3d2088230bb5ce466c9e974d6
@@ -39,6 +39,8 @@ public static function suite() {
$suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'router.test.php');
$suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'route' . DS . 'cake_route.test.php');
$suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'route' . DS . 'plugin_short_route.test.php');
$suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'cake_response.test.php');
$suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'cake_request.test.php');
$suite->addTestFile(CORE_TEST_CASES . DS . 'dispatcher.test.php');
return $suite;
}
@@ -742,6 +742,8 @@ function _detectCallback($request) {
* @return void
*/
function testHeader() {
$_SERVER['HTTP_HOST'] = 'localhost';
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-ca) AppleWebKit/534.8+ (KHTML, like Gecko) Version/5.0 Safari/533.16';
$request = new CakeRequest('/', false);
$this->assertEquals($_SERVER['HTTP_HOST'], $request->header('host'));
@@ -59,6 +59,10 @@ function endTest() {
* @return void
*/
function testFullBaseURL() {
$skip = PHP_SAPI == 'cli';
if ($skip) {
$this->markTestSkipped('Cannot validate base urls in CLI');
}
$this->assertPattern('/^http(s)?:\/\//', Router::url('/', true));
$this->assertPattern('/^http(s)?:\/\//', Router::url(null, true));
}

0 comments on commit 5308663

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