Skip to content

Commit

Permalink
Moved tags property to a jcr:content node + fixed other tests for tha…
Browse files Browse the repository at this point in the history
…t change
  • Loading branch information
Willem-Jan Zijderveld committed Feb 9, 2013
1 parent 5a88ec0 commit 904e95a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
14 changes: 10 additions & 4 deletions fixtures/general/base.xml
Expand Up @@ -180,10 +180,16 @@
<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="true" sv:type="String">
<sv:value>foo</sv:value>
<sv:value>bar</sv:value>
</sv:property>

<sv:node sv:name="jcr:content">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>nt:unstructured</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:node sv:name="deepnode">

Expand Down
8 changes: 4 additions & 4 deletions tests/06_Query/QuerySql2OperationsTest.php
Expand Up @@ -46,14 +46,14 @@ public function testQueryFieldSomenull()
$vals[] = ($node->hasProperty('foo') ? $node->getPropertyValue('foo') : null);
}
$this->assertContains('bar', $vals);
$this->assertEquals(8, count($vals));
$this->assertEquals(9, count($vals));

$vals = array();
foreach ($result->getRows() as $row) {
$vals[] = $row->getValue('foo');
}
$this->assertContains('bar', $vals);
$this->assertEquals(8, count($vals));
$this->assertEquals(9, count($vals));
}

public function testQueryFieldSelector()
Expand Down Expand Up @@ -135,15 +135,15 @@ public function testQueryOrder()
$vals[] = $row->getValue('data.zeronumber');
}
// rows that do not have that field are null. empty is before fields with values
$this->assertEquals(array(null, null, null, null, null, null, null, 0), $vals);
$this->assertEquals(array(null, 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
FROM [nt:unstructured] AS data
WHERE data.tags = "foo"
AND data.tags = "bar"
',
Expand Down

0 comments on commit 904e95a

Please sign in to comment.