From 8b8b268c088c7e6749c5e3b25d2a141a25508048 Mon Sep 17 00:00:00 2001 From: the_undefined Date: Thu, 28 Feb 2008 00:23:28 +0000 Subject: [PATCH] Added test demonstrating useless error messages being thrown for table-less models git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6480 3807eeeb-6ff5-0310-8944-8be069107fe0 --- .../cases/libs/view/helpers/form.test.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 2e1425e6a..b71ed1b53 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -190,6 +190,12 @@ class ValidateItem extends CakeTestModel { return false; } } + +class TestMail extends CakeTestModel { + var $primaryKey = 'id'; + var $useTable = false; + var $name = 'TestMail'; +} /** * Short description for class. * @@ -1560,6 +1566,18 @@ class FormHelperTest extends CakeTestCase { $result = $this->Form->input('MyOther.id'); $this->assertEqual($result, ''); } + + function testDbLessModel() { + $this->Form->create('TestMail'); + + $result = $this->Form->input('name'); + $this->assertEqual($result, '
'); + + ClassRegistry::init('TestMail'); + $this->Form->create('TestMail'); + $result = $this->Form->input('name'); + $this->assertEqual($result, '
'); + } function tearDown() { ClassRegistry::removeObject('view');