@@ -4718,9 +4718,13 @@ public function testSaveManyValidation() {
4718
4718
));
4719
4719
$ result = $ TestModel ->saveMany ($ data , array ('validate ' => true , 'atomic ' => false ));
4720
4720
$ this ->assertEqual ($ result , array (true , false ));
4721
- $ result = $ TestModel ->find ('all ' , array ('recursive ' => -1 , 'order ' => 'Post.id ASC ' ));
4721
+
4722
+ $ result = $ TestModel ->find ('all ' , array (
4723
+ 'fields ' => array ('id ' , 'author_id ' , 'title ' , 'body ' , 'published ' ),
4724
+ 'recursive ' => -1 ,
4725
+ 'order ' => 'Post.id ASC '
4726
+ ));
4722
4727
$ errors = array (1 => array ('title ' => array ('This field cannot be left blank ' )));
4723
- $ newTs = date ('Y-m-d H:i:s ' );
4724
4728
$ expected = array (
4725
4729
array (
4726
4730
'Post ' => array (
@@ -4729,8 +4733,6 @@ public function testSaveManyValidation() {
4729
4733
'title ' => 'Un-Baleeted First Post ' ,
4730
4734
'body ' => 'Not Baleeted! ' ,
4731
4735
'published ' => 'Y ' ,
4732
- 'created ' => '2007-03-18 10:39:23 ' ,
4733
- 'updated ' => $ newTs
4734
4736
)),
4735
4737
array (
4736
4738
'Post ' => array (
@@ -4739,8 +4741,6 @@ public function testSaveManyValidation() {
4739
4741
'title ' => 'Just update the title ' ,
4740
4742
'body ' => 'Second Post Body ' ,
4741
4743
'published ' => 'Y ' ,
4742
- 'created ' => '2007-03-18 10:41:23 ' ,
4743
- 'updated ' => $ ts
4744
4744
)),
4745
4745
array (
4746
4746
'Post ' => array (
@@ -4749,8 +4749,6 @@ public function testSaveManyValidation() {
4749
4749
'title ' => 'Third Post ' ,
4750
4750
'body ' => 'Third Post Body ' ,
4751
4751
'published ' => 'Y ' ,
4752
- 'created ' => '2007-03-18 10:43:23 ' ,
4753
- 'updated ' => '2007-03-18 10:45:31 '
4754
4752
)),
4755
4753
array (
4756
4754
'Post ' => array (
@@ -4759,8 +4757,6 @@ public function testSaveManyValidation() {
4759
4757
'title ' => 'Creating a fourth post ' ,
4760
4758
'body ' => 'Fourth post body ' ,
4761
4759
'published ' => 'N ' ,
4762
- 'created ' => $ ts ,
4763
- 'updated ' => $ ts
4764
4760
)));
4765
4761
$ this ->assertEqual ($ expected , $ result );
4766
4762
$ this ->assertEqual ($ TestModel ->validationErrors , $ errors );
@@ -4779,7 +4775,11 @@ public function testSaveManyValidation() {
4779
4775
));
4780
4776
$ this ->assertFalse ($ TestModel ->saveMany ($ data , array ('validate ' => 'first ' )));
4781
4777
4782
- $ result = $ TestModel ->find ('all ' , array ('recursive ' => -1 , 'order ' => 'Post.id ASC ' ));
4778
+ $ result = $ TestModel ->find ('all ' , array (
4779
+ 'fields ' => array ('id ' , 'author_id ' , 'title ' , 'body ' , 'published ' ),
4780
+ 'recursive ' => -1 ,
4781
+ 'order ' => 'Post.id ASC '
4782
+ ));
4783
4783
$ this ->assertEqual ($ expected , $ result );
4784
4784
$ this ->assertEqual ($ TestModel ->validationErrors , $ errors );
4785
4785
}
0 commit comments