@@ -92,9 +92,7 @@ public function it_updates_a_subset_of_a_doc()
92
92
$ doc = [
93
93
'some ' => [
94
94
'prop ' => 'foo ' ,
95
- 'other ' => [
96
- 'nested ' => 42
97
- ]
95
+ 'other ' => 'bar ' ,
98
96
],
99
97
'baz ' => 'bat ' ,
100
98
];
@@ -108,7 +106,7 @@ public function it_updates_a_subset_of_a_doc()
108
106
]);
109
107
110
108
$ filteredDocs = array_values (iterator_to_array ($ this ->store ->findDocs ('test ' , new EqFilter ('some.prop ' , 'fuzz ' ))));
111
- $ this ->assertEquals ( 42 , $ filteredDocs [0 ]['some ' ][ ' other ' ][ ' nested ' ]);
109
+ $ this ->assertArrayNotHasKey ( ' other ' , $ filteredDocs [0 ]['some ' ]);
112
110
}
113
111
114
112
/**
@@ -424,6 +422,7 @@ public function it_ensures_unique_constraints_for_multiple_fields()
424
422
425
423
$ this ->store ->addDoc ('test ' , '1 ' , ['some ' => ['prop ' => 'foo ' , 'other ' => ['prop ' => 'bat ' ]]]);
426
424
$ this ->store ->addDoc ('test ' , '2 ' , ['some ' => ['prop ' => 'bar ' , 'other ' => ['prop ' => 'bat ' ]]]);
425
+ $ this ->store ->addDoc ('test ' , '3 ' , ['some ' => ['prop ' => 'bar ' ]]);
427
426
428
427
$ this ->expectExceptionMessageRegExp ('/^Unique constraint violation/ ' );
429
428
$ this ->store ->addDoc ('test ' , '4 ' , ['some ' => ['prop ' => 'foo ' , 'other ' => ['prop ' => 'bat ' ]]]);
@@ -443,7 +442,7 @@ public function it_ensures_unique_constraints_for_multiple_fields_for_update()
443
442
$ this ->store ->addDoc ('test ' , '3 ' , ['some ' => ['prop ' => 'bar ' ]]);
444
443
445
444
$ this ->expectExceptionMessageRegExp ('/^Unique constraint violation/ ' );
446
- $ this ->store ->updateDoc ('test ' , '2 ' , ['some ' => ['prop ' => 'foo ' ]]);
445
+ $ this ->store ->updateDoc ('test ' , '2 ' , ['some ' => ['prop ' => 'foo ' , ' other ' => [ ' prop ' => ' bat ' ] ]]);
447
446
}
448
447
449
448
/**
@@ -574,7 +573,7 @@ public function it_deletes_many()
574
573
/**
575
574
* @test
576
575
*/
577
- public function it_does_not_update_numeric_arrays_recursively ()
576
+ public function it_does_not_update_arrays_recursively ()
578
577
{
579
578
$ this ->store ->addCollection ('test ' );
580
579
@@ -604,13 +603,13 @@ public function it_does_not_update_numeric_arrays_recursively()
604
603
605
604
$ this ->assertEquals (
606
605
[
607
- 'a ' => ['a ' => 10 , ' b ' => 21 , 'c ' => 30 ],
606
+ 'a ' => ['b ' => 21 , 'c ' => 30 ],
608
607
'b ' => [10 , 30 ],
609
608
'c ' => [true ],
610
609
'd ' => [],
611
- 'e ' => [' a ' => ' b ' ],
612
- 'f ' => [10 , 20 , 'x ' => 10 , 'y ' => 20 ],
613
- 'g ' => [' x ' => 10 , ' y ' => 20 , 30 , 40 ],
610
+ 'e ' => [],
611
+ 'f ' => ['x ' => 10 , 'y ' => 20 ],
612
+ 'g ' => [30 , 40 ],
614
613
'h ' => [11 ],
615
614
'i ' => [22 ],
616
615
'j ' => ['bar ' ]
0 commit comments