diff --git a/cake/tests/cases/libs/cake_test_case.test.php b/cake/tests/cases/libs/cake_test_case.test.php index f88b9937867..e9f885fab52 100644 --- a/cake/tests/cases/libs/cake_test_case.test.php +++ b/cake/tests/cases/libs/cake_test_case.test.php @@ -184,7 +184,7 @@ function testAssertTagsQuotes() { '/a' ); $this->assertTrue($this->Case->assertTags($input, $pattern), 'Single quoted attributes %s'); - + $input = "My link"; $pattern = array( 'a' => array('href' => 'preg:/.*\.html/', 'class' => 'active'), @@ -348,10 +348,10 @@ function testTestAction() { ), true); $result = $this->Case->testAction('/tests_apps/index', array('return' => 'view')); - $this->assertPattern('/This is the TestsAppsController index view/', $result); + $this->assertPattern('/^\s*This is the TestsAppsController index view\s*$/i', $result); $result = $this->Case->testAction('/tests_apps/index', array('return' => 'contents')); - $this->assertPattern('/This is the TestsAppsController index view/', $result); + $this->assertPattern('/\bThis is the TestsAppsController index view\b/i', $result); $this->assertPattern('/assertPattern('/<\/html>/', $result); @@ -499,4 +499,4 @@ function testTestDispatcher() { $return = $Dispatcher->dispatch('/tests_apps/index', array('autoRender' => 0, 'return' => 1, 'requested' => 1)); } -} +} \ No newline at end of file diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index 06a96b51dce..1d4b89eb569 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -64,6 +64,10 @@ function testCase(&$testCase) { function _invoke(&$controller, $params, $missingAction = false) { $this->controller =& $controller; + if (array_key_exists('layout', $params)) { + $this->controller->layout = $params['layout']; + } + if (isset($this->testCase) && method_exists($this->testCase, 'startController')) { $this->testCase->startController($this->controller, $params); } @@ -828,4 +832,4 @@ function __array_permute($items, $perms = array()) { return $permuted; } } -} +} \ No newline at end of file