mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
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
This commit is contained in:
parent
d3e2d51cbc
commit
8b8b268c08
1 changed files with 18 additions and 0 deletions
|
@ -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, '<input type="hidden" name="data[MyOther][id]" value="" id="MyOtherId" />');
|
||||
}
|
||||
|
||||
function testDbLessModel() {
|
||||
$this->Form->create('TestMail');
|
||||
|
||||
$result = $this->Form->input('name');
|
||||
$this->assertEqual($result, '<div class="input"><label for="TestMailName">Name</label><input name="data[TestMail][name]" type="text" value="" id="TestMailName" /></div>');
|
||||
|
||||
ClassRegistry::init('TestMail');
|
||||
$this->Form->create('TestMail');
|
||||
$result = $this->Form->input('name');
|
||||
$this->assertEqual($result, '<div class="input"><label for="TestMailName">Name</label><input name="data[TestMail][name]" type="text" value="" id="TestMailName" /></div>');
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
ClassRegistry::removeObject('view');
|
||||
|
|
Loading…
Add table
Reference in a new issue