Skip to content
Open
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
19 changes: 19 additions & 0 deletions fixtures/06_Query/characters.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,23 @@
</sv:node>
</sv:node>
</sv:node>

<sv:node sv:name="test-2e">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>nt:unstructured</sv:value>
</sv:property>

<sv:node sv:name="child">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>nt:unstructured</sv:value>
</sv:property>

<sv:property sv:name="jcr:mixinTypes" sv:type="Name">
<sv:value>mix:referenceable</sv:value>
</sv:property>
<sv:property sv:name="jcr:uuid" sv:type="String">
<sv:value>123e61c0-09ab-42a9-87c0-123ccc90e6f4</sv:value>
</sv:property>
</sv:node>
</sv:node>
</sv:node>
18 changes: 18 additions & 0 deletions tests/Query/CharacterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,22 @@ public function testQueryWithAmpersand()
$this->assertCount(1, $rows);
$this->assertEquals('foo & bar&baz', $rows->current()->getValue('ampersand'));
}

public function testNodeNameWithMinus()
{
/** @var QueryManagerInterface $queryManager */
$queryManager = $this->sharedFixture['qm'];
$query = $queryManager->createQuery('
SELECT node.[jcr:uuid] AS uuid
FROM [nt:unstructured] AS node
WHERE ISCHILDNODE(node, [/tests_query_encoding/test-2e])',
QueryInterface::JCR_SQL2
);

$result = $query->execute();

$rows = $result->getRows();
$this->assertCount(1, $rows);
$this->assertEquals('PHPCR\Query\QueryInterface', $rows->current()->getValue('class'));
}
}