|
|
@@ -423,11 +423,22 @@ class ModelTaskTest extends TestCase {
|
|
|
$model = TableRegistry::get('BakeArticles');
|
|
|
$result = $this->Task->getValidation($model);
|
|
|
$expected = [
|
|
|
- 'id' => ['rule' => 'numeric', 'allowEmpty' => 'create'],
|
|
|
'bake_user_id' => ['rule' => 'numeric', 'allowEmpty' => false],
|
|
|
'title' => ['rule' => false, 'allowEmpty' => false],
|
|
|
'body' => ['rule' => false, 'allowEmpty' => true],
|
|
|
'published' => ['rule' => 'boolean', 'allowEmpty' => true],
|
|
|
+ 'id' => ['rule' => 'numeric', 'allowEmpty' => 'create']
|
|
|
+ ];
|
|
|
+ $this->assertEquals($expected, $result);
|
|
|
+
|
|
|
+ $model = TableRegistry::get('BakeComments');
|
|
|
+ $result = $this->Task->getValidation($model);
|
|
|
+ $expected = [
|
|
|
+ 'bake_article_id' => ['rule' => 'numeric', 'allowEmpty' => false],
|
|
|
+ 'bake_user_id' => ['rule' => 'numeric', 'allowEmpty' => false],
|
|
|
+ 'comment' => ['rule' => false, 'allowEmpty' => true],
|
|
|
+ 'published' => ['rule' => false, 'allowEmpty' => true],
|
|
|
+ 'otherid' => ['rule' => 'numeric', 'allowEmpty' => 'create']
|
|
|
];
|
|
|
$this->assertEquals($expected, $result);
|
|
|
}
|