Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions fixtures/general/base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@
<sv:value>text/plain</sv:value>
</sv:property>

<sv:property sv:name="tags" sv:multiple="true" sv:type="String">
<sv:value>foo</sv:value>
<sv:value>bar</sv:value>
</sv:property>

<sv:node sv:name="Test escaping_x0020bla &lt;&gt;'&quot; node"> <!-- TODO: if https://issues.apache.org/jira/browse/JCR-2997 is fixed, add a space after _x0020 -->
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>nt:unstructured</sv:value>
Expand Down
22 changes: 22 additions & 0 deletions tests/06_Query/QuerySql2OperationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:unstructured] 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->assertCount(1, $rows, 'Expected one row with both tags present');
$this->assertSame('foo bar', $rows->current()->getValue('tags'));
}

}