diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index 774aa9ae9..46f30bdb7 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -2299,6 +2299,9 @@ class DboSourceTest extends CakeTestCase { * @return void */ function testArrayConditionsParsing() { + $result = $this->testDb->conditions(array('Stereo.type' => 'in dash speakers')); + $this->assertPattern("/^\s+WHERE\s+`Stereo`.`type`\s+=\s+'in dash speakers'/", $result); + $result = $this->testDb->conditions(array('Candy.name LIKE' => 'a', 'HardCandy.name LIKE' => 'c')); $this->assertPattern("/^\s+WHERE\s+`Candy`.`name` LIKE\s+'a'\s+AND\s+`HardCandy`.`name`\s+LIKE\s+'c'/", $result); diff --git a/cake/tests/cases/libs/model/model.test.php b/cake/tests/cases/libs/model/model.test.php index 29d668181..0eee34296 100644 --- a/cake/tests/cases/libs/model/model.test.php +++ b/cake/tests/cases/libs/model/model.test.php @@ -4761,11 +4761,13 @@ class ModelTest extends CakeTestCase { $this->loadFixtures('DataTest'); $TestModel =& new DataTest(); - $TestModel->create(array()) && $TestModel->save(); + $TestModel->create(array()); + $TestModel->save(); $result = $TestModel->findById($TestModel->id); $this->assertIdentical($result['DataTest']['count'], '0'); $this->assertIdentical($result['DataTest']['float'], '0'); } + /** * testNonNumericHabtmJoinKey method * diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index e1fee85ed..75e1daa16 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -1399,6 +1399,20 @@ class FormHelperTest extends CakeTestCase { '/div' ); $this->assertTags($result, $expected); + + for ($i = 1; $i < 5; $i++) { + $result = $this->Form->input("Contact.{$i}.email", array('type' => 'checkbox', 'value' => $i)); + $expected = array( + 'div' => array('class' => 'input checkbox'), + 'input' => array('type' => 'hidden', 'name' => "data[Contact][{$i}][email]", 'value' => '0', 'id' => "Contact{$i}Email_"), + array('input' => array('type' => 'checkbox', 'name' => "data[Contact][{$i}][email]", 'value' => $i, 'id' => "Contact{$i}Email")), + 'label' => array('for' => "Contact{$i}Email"), + 'Email', + '/label', + '/div' + ); + $this->assertTags($result, $expected); + } } /** * testFormInputs method