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