From c4f03bf2377c58c448d08dc50fff6d37f9398def Mon Sep 17 00:00:00 2001 From: nate Date: Tue, 1 Apr 2008 03:34:57 +0000 Subject: [PATCH] Updating View test case for rendering refactor git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6615 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/tests/cases/libs/view/view.test.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/cake/tests/cases/libs/view/view.test.php b/cake/tests/cases/libs/view/view.test.php index 29adec53f..cee393787 100644 --- a/cake/tests/cases/libs/view/view.test.php +++ b/cake/tests/cases/libs/view/view.test.php @@ -270,12 +270,9 @@ class ViewTest extends UnitTestCase { } function testRender() { - restore_error_handler(); $View = new TestView($this->PostsController); - ob_start(); - $View->render('index'); - $result = str_replace(array("\t", "\r\n", "\n"), "", ob_get_clean()); - set_error_handler('simpleTestErrorHandler'); + $result = str_replace(array("\t", "\r\n", "\n"), "", $View->render('index')); + $this->assertPattern("//", $result); $this->assertPattern("/<div id=\"content\">posts index<\/div>/", $result); $this->assertPattern("/<div id=\"content\">posts index<\/div>/", $result); @@ -285,12 +282,8 @@ class ViewTest extends UnitTestCase { $this->PostsController->set('pause', 3); $this->PostsController->set('page_title', 'yo what up'); - restore_error_handler(); $View = new TestView($this->PostsController); - ob_start(); - $View->render(false, 'flash'); - $result = str_replace(array("\t", "\r\n", "\n"), "", ob_get_clean()); - set_error_handler('simpleTestErrorHandler'); + $result = str_replace(array("\t", "\r\n", "\n"), "", $View->render(false, 'flash')); $this->assertPattern("/<title>yo what up<\/title>/", $result); $this->assertPattern("/<p><a href=\"flash\">yo what up<\/a><\/p>/", $result);