diff --git a/fixtures/general/base.xml b/fixtures/general/base.xml index 2c62baff..cec56a42 100644 --- a/fixtures/general/base.xml +++ b/fixtures/general/base.xml @@ -360,6 +360,12 @@ 2 + + 4 + 2 + 8 + + 2 diff --git a/tests/Query/QueryResultsTest.php b/tests/Query/QueryResultsTest.php index 0e7675e6..7f3ee70a 100644 --- a/tests/Query/QueryResultsTest.php +++ b/tests/Query/QueryResultsTest.php @@ -172,6 +172,30 @@ public function testCompareNumberFields() $this->assertEquals(10, $rows[0]->getValue('data.longNumberToCompare')); } + public function testCompareNumberFieldsMulti() + { + $query = $this->sharedFixture['qm']->createQuery(' + SELECT data.longNumberToCompareMulti + FROM [nt:unstructured] AS data + WHERE data.longNumberToCompareMulti = 2 + AND ISDESCENDANTNODE([/tests_general_base]) + ', + \PHPCR\Query\QueryInterface::JCR_SQL2 + ); + $result = $query->execute(); + + $rows = array(); + foreach ($result->getRows() as $row) { + $rows[] = $row; + } + + $this->assertCount(1, $rows); + + // returning a string value is, perhaps suprisingly, the correct behavior. + $this->assertEquals('4 2 8', $rows[0]->getValue('data.longNumberToCompareMulti')); + } + + public function testCompareStringFields() { $query = $this->sharedFixture['qm']->createQuery(