From fb7c56024ce593667ae65786a34a566d7083bbc8 Mon Sep 17 00:00:00 2001 From: nate Date: Fri, 16 Mar 2007 14:58:19 +0000 Subject: [PATCH] Shortening notation in Session test, removing debug data from HtmlHelper test git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4621 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/tests/cases/libs/session.test.php | 41 ++++++++----------- .../cases/libs/view/helpers/html.test.php | 13 +++--- 2 files changed, 23 insertions(+), 31 deletions(-) diff --git a/cake/tests/cases/libs/session.test.php b/cake/tests/cases/libs/session.test.php index d81bc6ccf..bf2ae822f 100644 --- a/cake/tests/cases/libs/session.test.php +++ b/cake/tests/cases/libs/session.test.php @@ -1,5 +1,5 @@ Session->write('SessionTestCase', 'value'); - $result = $this->Session->check('SessionTestCase'); - $this->assertEqual($result, true); - - $result = $this->Session->check('NotExistingSessionTestCase'); - $this->assertEqual($result, false); + $this->assertTrue($this->Session->check('SessionTestCase')); + + $this->assertFalse($this->Session->check('NotExistingSessionTestCase'), false); } function testCheckingSavedEmpty() { $this->Session->write('SessionTestCase', 0); - $result = $this->Session->check('SessionTestCase'); - $this->assertEqual($result, true); + $this->assertTrue($this->Session->check('SessionTestCase')); $this->Session->write('SessionTestCase', '0'); - $result = $this->Session->check('SessionTestCase'); - $this->assertEqual($result, true); + $this->assertTrue($this->Session->check('SessionTestCase')); $this->Session->write('SessionTestCase', false); - $result = $this->Session->check('SessionTestCase'); - $this->assertEqual($result, true); + $this->assertTrue($this->Session->check('SessionTestCase')); $this->Session->write('SessionTestCase', null); - $result = $this->Session->check('SessionTestCase'); - $this->assertEqual($result, null); + $this->assertFalse($this->Session->check('SessionTestCase')); } function testReadingSavedEmpty() { $this->Session->write('SessionTestCase', 0); - $result = $this->Session->read('SessionTestCase'); - $this->assertEqual($result, 0); + $this->assertEqual($this->Session->read('SessionTestCase'), 0); $this->Session->write('SessionTestCase', '0'); - $result = $this->Session->read('SessionTestCase'); - $this->assertEqual($result, '0'); + $this->assertEqual($this->Session->read('SessionTestCase'), '0'); + $this->assertFalse($this->Session->read('SessionTestCase') === 0); $this->Session->write('SessionTestCase', false); - $result = $this->Session->read('SessionTestCase'); - $this->assertEqual($result, false); + $this->assertFalse($this->Session->read('SessionTestCase')); $this->Session->write('SessionTestCase', null); - $result = $this->Session->read('SessionTestCase'); - $this->assertEqual($result, null); + $this->assertEqual($this->Session->read('SessionTestCase'), null); } function tearDown() { diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/cake/tests/cases/libs/view/helpers/html.test.php index d5ffba104..3e5058c41 100644 --- a/cake/tests/cases/libs/view/helpers/html.test.php +++ b/cake/tests/cases/libs/view/helpers/html.test.php @@ -42,29 +42,30 @@ class HtmlHelperTest extends UnitTestCase { var $html = null; function setUp() { - $this->html = new HtmlHelper(); + $this->Html = new HtmlHelper(); $view = new View(new TheHtmlTestController()); ClassRegistry::addObject('view', $view); } function testSelectTag() { - @$result = $this->html->selectTag('Model/field', array()); + @$result = $this->Html->selectTag('Model/field', array()); $this->assertPattern('/^