Skip to content

Commit 8912847

Browse files
author
Willem-Jan Zijderveld
committed
Moved a test from phpcr-utils to phpcr-api-tests, it shows an issue with parsing literals
1 parent affab2a commit 8912847

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/06_Query/QOM/Sql2ToQomConverterTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,18 @@ public function testQueries()
7575
}
7676
}
7777
}
78+
79+
public function testPropertyComparisonWithWhitespace()
80+
{
81+
$sql2 = 'SELECT * FROM [nt:file] WHERE prop1 = "Foo bar"';
82+
83+
$qom = $this->parser->parse($sql2);
84+
85+
$this->assertInstanceOf('PHPCR\Query\QOM\ComparisonInterface', $qom->getConstraint());
86+
$this->assertInstanceOf('PHPCR\Query\QOM\PropertyValueInterface', $qom->getConstraint()->getOperand1());
87+
$this->assertInstanceOf('PHPCR\Query\QOM\LiteralInterface', $qom->getConstraint()->getOperand2());
88+
89+
$this->assertEquals('prop1', $qom->getConstraint()->getOperand1()->getPropertyName());
90+
$this->assertEquals('Foo bar', $qom->getConstraint()->getOperand2()->getLiteralValue());
91+
}
7892
}

0 commit comments

Comments
 (0)