Пример #1
0
 /**
  * testSaveManyDeepHasManyValidationFailure method
  *
  * @return void
  */
 public function testSaveManyDeepHasManyValidationFailure()
 {
     $this->loadFixtures('Boat', 'Comment');
     $TestModel = new Boat();
     $TestModel->Comment->validate = array('comment' => array('notBlank' => array('rule' => array('notBlank'))));
     $result = $TestModel->saveMany(array(array('user_id' => 1, 'title' => 'New Boat', 'body' => 'This article contains a invalid comment', 'Comment' => array(array('user_id' => 1, 'comment' => '')))), array('deep' => true));
     $this->assertFalse($result);
     $this->assertEquals(array(array('Comment' => array(array('comment' => array('notBlank'))))), $TestModel->validationErrors);
 }