Skip to content

reproduce encoding bug with ischildnode query paths #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 2.1.x
Choose a base branch
from
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'));
}
}