Skip to content
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

add some tests about content encoding when writing, reading and querying #119

Merged
merged 1 commit into from Oct 8, 2013

Conversation

dbu
Copy link
Member

@dbu dbu commented Oct 7, 2013

these tests succeed on jackalope-jackrabbit

will be interesting if all are well on jackalope-doctrine-dbal as well.

@@ -58,6 +58,10 @@
<sv:property sv:name="quoteandbackslash" sv:type="String">
<sv:value>'a\'\'b\'\'c'</sv:value>
</sv:property>

<sv:property sv:name="ampersand" sv:type="String">
<sv:value>foo &amp; bar&amp;baz</sv:value>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is xml, so & has to be escaped

@lsmith77
Copy link
Member

lsmith77 commented Oct 7, 2013

There was 1 error:

1) PHPCR\Tests\Query\CharacterTest::testQueryWithAmpersand
PHPCR\Query\InvalidQueryException: Invalid query:
            SELECT data.ampersand
            FROM [nt:unstructured] AS data
            WHERE data.ampersand = "foo & bar&baz"


/Users/lsmith/htdocs/cmf-sandbox/vendor/jackalope/jackalope-doctrine-dbal/src/Jackalope/Transport/DoctrineDBAL/Client.php:1909
/Users/lsmith/htdocs/cmf-sandbox/vendor/jackalope/jackalope-doctrine-dbal/vendor/jackalope/jackalope/src/Jackalope/Query/Query.php:98
/Users/lsmith/htdocs/cmf-sandbox/vendor/jackalope/jackalope-doctrine-dbal/vendor/phpcr/phpcr-api-tests/tests/06_Query/CharacterTest.php:129

This exception is triggered by:

            $parser = new Sql2ToQomQueryConverter($this->factory->get('Query\QOM\QueryObjectModelFactory'));
            try {
                $qom = $parser->parse($query->getStatement());
                $qom->setLimit($query->getLimit());
                $qom->setOffset($query->getOffset());
            } catch (\Exception $e) {
                throw new InvalidQueryException('Invalid query: '.$query->getStatement());
            }

lsmith77 added a commit that referenced this pull request Oct 8, 2013
add some tests about content encoding when writing, reading and querying
@lsmith77 lsmith77 merged commit 7726fec into master Oct 8, 2013
@lsmith77 lsmith77 deleted the add-encoding-tests branch October 8, 2013 14:41
dantleech pushed a commit to dantleech/phpcr-utils that referenced this pull request Dec 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants