Skip to content

Commit

Permalink
Adding test to disprove #385. Proves saveAll with validate => first b…
Browse files Browse the repository at this point in the history
…ehaves correctly.
  • Loading branch information
markstory committed Dec 4, 2009
1 parent be64f26 commit cc750d1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cake/tests/cases/libs/model/model_write.test.php
Expand Up @@ -3067,6 +3067,19 @@ function testSaveAllHasOne() {
'attachment' => 'some_file.zip'
)));
$this->assertEqual($result, $expected);


$model->Attachment->bindModel(array('belongsTo' => array('Comment')), false);
$data = array(
'Comment' => array(
'comment' => 'Comment with attachment',
'article_id' => 1,
'user_id' => 1
),
'Attachment' => array(
'attachment' => 'some_file.zip'
));
$this->assertTrue($model->saveAll($data, array('validate' => 'first')));
}
/**
* testSaveAllBelongsTo method
Expand Down

0 comments on commit cc750d1

Please sign in to comment.