mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding CakeRequest and CakeResponse to the routing group.
Making more tests not fail in cli.
This commit is contained in:
parent
0a1bc06843
commit
53086635b3
3 changed files with 8 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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'));
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue