diff --git a/fixtures/general/base.xml b/fixtures/general/base.xml index 0cb61cfd..b2eb3065 100644 --- a/fixtures/general/base.xml +++ b/fixtures/general/base.xml @@ -180,6 +180,10 @@ 14e18ef3-be20-4985-bee9-7bb4763b31de + + foo + bar + diff --git a/tests/06_Query/QuerySql2OperationsTest.php b/tests/06_Query/QuerySql2OperationsTest.php index 13acae83..b4cafb89 100644 --- a/tests/06_Query/QuerySql2OperationsTest.php +++ b/tests/06_Query/QuerySql2OperationsTest.php @@ -138,4 +138,26 @@ public function testQueryOrder() $this->assertEquals(array(null, null, null, null, null, null, null, 0), $vals); } + public function testQueryMultiValuedProperty() + { + /** @var $query \PHPCR\Query\QueryInterface */ + $query = $this->sharedFixture['qm']->createQuery( + 'SELECT data.tags + FROM [nt:folder] AS data + WHERE data.tags = "foo" + AND data.tags="bar" + ', + \PHPCR\Query\QueryInterface::JCR_SQL2 + ); + + $this->assertInstanceOf('\PHPCR\Query\QueryInterface', $query); + $result = $query->execute(); + $this->assertInstanceOf('\PHPCR\Query\QueryResultInterface', $result); + + $rows = $result->getRows(); + + $this->assertSame(1, count($rows), 'Expected one row with both tags present'); + $this->assertSame(array('foo', 'bar'), $rows->current()->getValue('tags')); + } + }