Skip to content

Commit fedcf10

Browse files
authored
Merge 4f61d83 into 77b06f4
2 parents 77b06f4 + 4f61d83 commit fedcf10

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

tests/Parse/ParseQueryTest.php

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2719,4 +2719,56 @@ public function testUnknownCondition()
27192719
'unrecognized' => 1
27202720
]);
27212721
}
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+
}
27222774
}

0 commit comments

Comments
 (0)