Skip to content

Commit 5c0c1d5

Browse files
committed
Merge pull request #114 from wjzijderveld/sql2-qom-converter-tests
Moved a test from phpcr-utils to phpcr-api-tests,
2 parents 6a81378 + 8912847 commit 5c0c1d5

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)