File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -2719,4 +2719,56 @@ public function testUnknownCondition()
2719
2719
'unrecognized ' => 1
2720
2720
]);
2721
2721
}
2722
+
2723
+ public function testEqualToWithSameKeyAndWithOthersConditionsReturnWrongResult ()
2724
+ {
2725
+ $ baz = new ParseObject ('TestObject ' );
2726
+ $ baz ->setArray ('fooStack ' , [
2727
+ [
2728
+ 'status ' => 'baz '
2729
+ ],
2730
+ [
2731
+ 'status ' => 'bar '
2732
+ ]
2733
+ ]);
2734
+ $ baz ->save ();
2735
+
2736
+ $ bar = new ParseObject ('TestObject ' );
2737
+ $ bar ->setArray ('fooStack ' , [
2738
+ [
2739
+ 'status ' => 'bar '
2740
+ ]
2741
+ ]);
2742
+ $ bar ->save ();
2743
+
2744
+ $ qux = new ParseObject ('TestObject ' );
2745
+ $ qux ->setArray ('fooStack ' , [
2746
+ [
2747
+ 'status ' => 'bar ' ,
2748
+ ],
2749
+ [
2750
+ 'status ' => 'qux '
2751
+ ]
2752
+ ]);
2753
+ $ qux ->save ();
2754
+
2755
+ $ query = new ParseQuery ('TestObject ' );
2756
+ $ query ->notEqualTo ('fooStack.status ' , 'baz ' );
2757
+ $ query ->equalTo ('fooStack.status ' , 'bar ' );
2758
+
2759
+ $ this ->assertEquals (3 , $ query ->count (true ));
2760
+ }
2761
+
2762
+ public function testEqualToWithSameKeyAndOthersConditionsReturnStructQueryWrong ()
2763
+ {
2764
+ $ query = new ParseQuery ('TestObject ' );
2765
+ $ query ->notEqualTo ('key ' , 'value3 ' );
2766
+ $ query ->equalTo ('key ' , 'value ' );
2767
+
2768
+ $ this ->assertSame ([
2769
+ 'where ' => [
2770
+ 'key ' => 'value '
2771
+ ]
2772
+ ], $ query ->_getOptions ());
2773
+ }
2722
2774
}
You can’t perform that action at this time.
0 commit comments