Adding CakeRequest and CakeResponse to the routing group.

Making more tests not fail in cli.
This commit is contained in:
mark_story 2010-09-19 21:40:35 -04:00
parent 0a1bc06843
commit 53086635b3
3 changed files with 8 additions and 0 deletions

View file

@ -39,6 +39,8 @@ class AllRoutingTest extends PHPUnit_Framework_TestSuite {
$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;
}

View file

@ -742,6 +742,8 @@ class CakeRequestTestCase extends CakeTestCase {
* @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'));

View file

@ -59,6 +59,10 @@ class RouterTest extends CakeTestCase {
* @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));
}