Skip to content

Commit

Permalink
Added a multi-valued test. Failing for Jackaplope Doctrine Dbal trans…
Browse files Browse the repository at this point in the history
…port
  • Loading branch information
Willem-Jan Zijderveld committed Feb 9, 2013
1 parent 590b894 commit c8840a5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fixtures/general/base.xml
Expand Up @@ -180,6 +180,10 @@
<sv:property sv:name="jcr:uuid" sv:type="String">
<sv:value>14e18ef3-be20-4985-bee9-7bb4763b31de</sv:value>
</sv:property>
<sv:property sv:name="tags" sv:multiple="1" sv:type="String">
<sv:value>foo</sv:value>
<sv:value>bar</sv:value>
</sv:property>

<sv:node sv:name="deepnode">

Expand Down
22 changes: 22 additions & 0 deletions tests/06_Query/QuerySql2OperationsTest.php
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: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'));
}

}

0 comments on commit c8840a5

Please sign in to comment.