Skip to content

Commit da53f30

Browse files
committed
reproduce encoding bug with ischildnode query paths
1 parent 753aa92 commit da53f30

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

fixtures/06_Query/characters.xml

+19
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,23 @@
6565
</sv:node>
6666
</sv:node>
6767
</sv:node>
68+
69+
<sv:node sv:name="test-2e">
70+
<sv:property sv:name="jcr:primaryType" sv:type="Name">
71+
<sv:value>nt:unstructured</sv:value>
72+
</sv:property>
73+
74+
<sv:node sv:name="child">
75+
<sv:property sv:name="jcr:primaryType" sv:type="Name">
76+
<sv:value>nt:unstructured</sv:value>
77+
</sv:property>
78+
79+
<sv:property sv:name="jcr:mixinTypes" sv:type="Name">
80+
<sv:value>mix:referenceable</sv:value>
81+
</sv:property>
82+
<sv:property sv:name="jcr:uuid" sv:type="String">
83+
<sv:value>123e61c0-09ab-42a9-87c0-123ccc90e6f4</sv:value>
84+
</sv:property>
85+
</sv:node>
86+
</sv:node>
6887
</sv:node>

tests/Query/CharacterTest.php

+18
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,22 @@ public function testQueryWithAmpersand()
138138
$this->assertCount(1, $rows);
139139
$this->assertEquals('foo & bar&baz', $rows->current()->getValue('ampersand'));
140140
}
141+
142+
public function testNodeNameWithMinus()
143+
{
144+
/** @var QueryManagerInterface $queryManager */
145+
$queryManager = $this->sharedFixture['qm'];
146+
$query = $queryManager->createQuery('
147+
SELECT node.[jcr:uuid] AS uuid
148+
FROM [nt:unstructured] AS node
149+
WHERE ISCHILDNODE(node, [/tests_query_encoding/test-2e])',
150+
QueryInterface::JCR_SQL2
151+
);
152+
153+
$result = $query->execute();
154+
155+
$rows = $result->getRows();
156+
$this->assertCount(1, $rows);
157+
$this->assertEquals('PHPCR\Query\QueryInterface', $rows->current()->getValue('class'));
158+
}
141159
}

0 commit comments

Comments
 (0)