mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Adding a test for saving blank fields on a model. Closes #1243.
This commit is contained in:
parent
f5fd069583
commit
f29bb562cb
1 changed files with 21 additions and 0 deletions
|
@ -2245,6 +2245,27 @@ class ModelWriteTest extends BaseModelTest {
|
|||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* test updating records and saving blank values.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function testUpdateSavingBlankValues() {
|
||||
$this->loadFixtures('Article');
|
||||
$Article =& new Article();
|
||||
$Article->validate = array();
|
||||
$Article->create();
|
||||
$result = $Article->save(array(
|
||||
'id' => 1,
|
||||
'title' => '',
|
||||
'body' => ''
|
||||
));
|
||||
$this->assertTrue($result);
|
||||
$result = $Article->find('first', array('conditions' => array('Article.id' => 1)));
|
||||
$this->assertEqual('', $result['Article']['title'], 'Title is not blank');
|
||||
$this->assertEqual('', $result['Article']['body'], 'Body is not blank');
|
||||
}
|
||||
|
||||
/**
|
||||
* testUpdateMultiple method
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue