From 0d863c389d4ae68782c562d5fcf460d1d93e850d Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Wed, 10 Jul 2013 09:28:59 +0200 Subject: [PATCH] Revert "Added some Sql2 to QOM converter tests" as it depends on jackalope This reverts commit 05271b62e771823fb505d4797831cad474a03461. --- .../Util/QOM/Sql2ToQomQueryConverterTest.php | 89 ------------------- 1 file changed, 89 deletions(-) delete mode 100644 tests/PHPCR/Tests/Util/QOM/Sql2ToQomQueryConverterTest.php diff --git a/tests/PHPCR/Tests/Util/QOM/Sql2ToQomQueryConverterTest.php b/tests/PHPCR/Tests/Util/QOM/Sql2ToQomQueryConverterTest.php deleted file mode 100644 index dce9e66..0000000 --- a/tests/PHPCR/Tests/Util/QOM/Sql2ToQomQueryConverterTest.php +++ /dev/null @@ -1,89 +0,0 @@ -factory = new QueryObjectModelFactory(new Factory()); - $this->converter = new Sql2ToQomQueryConverter($this->factory); - } - - public function testPropertyComparison() - { - $qom = $this->converter->parse(' - SELECT data - FROM [nt:unstructured] AS data - WHERE data.property = "String with spaces" - '); - - $this->assertInstanceOf('PHPCR\Query\QOM\ComparisonInterface', $qom->getConstraint()); - $this->assertInstanceOf('PHPCR\Query\QOM\PropertyValueInterface', $qom->getConstraint()->getOperand1()); - $this->assertInstanceOf('PHPCR\Query\QOM\LiteralInterface', $qom->getConstraint()->getOperand2()); - - $this->assertEquals('property', $qom->getConstraint()->getOperand1()->getPropertyName()); - $this->assertEquals('String with spaces', $qom->getConstraint()->getOperand2()->getLiteralValue()); - } - - public function testPropertyExistence() - { - $qom = $this->converter->parse(' - SELECT data - FROM [nt:unstructured] AS data - WHERE data.property IS NULL - '); - - $this->assertInstanceOf('PHPCR\Query\QOM\NotInterface', $qom->getConstraint()); - $this->assertInstanceOf('PHPCR\Query\QOM\PropertyExistenceInterface', $qom->getConstraint()->getConstraint()); - - $qom = $this->converter->parse(' - SELECT data - FROM [nt:unstructured] AS data - WHERE data.property IS NOT NULL - '); - - $this->assertInstanceOf('PHPCR\Query\QOM\PropertyExistenceInterface', $qom->getConstraint()); - } - - public function testComposedConstraint() - { - $qom = $this->converter->parse(' - SELECT data - FROM [nt:unstructured] AS data - WHERE data.property = "foo" - OR data.property = "bar" - '); - - $this->assertInstanceOf('PHPCR\Query\QOM\OrInterface', $qom->getConstraint()); - $this->assertInstanceOf('PHPCR\Query\QOM\ComparisonInterface', $qom->getConstraint()->getConstraint1()); - $this->assertInstanceOf('PHPCR\Query\QOM\ComparisonInterface', $qom->getConstraint()->getConstraint2()); - - $this->assertInstanceOf('PHPCR\Query\QOM\PropertyValueInterface', $qom->getConstraint()->getConstraint1()->getOperand1()); - $this->assertInstanceOf('PHPCR\Query\QOM\LiteralInterface', $qom->getConstraint()->getConstraint1()->getOperand2()); - } - - public function testJoinConstraint() - { - $qom = $this->converter->parse(' - SELECT data - FROM [nt:unstructured] AS data - JOIN [nt:folder] AS folder ON data.folder = folder.[jcr:uuid] - '); - - $this->assertInstanceOf('PHPCR\Query\QOM\JoinInterface', $qom->getSource()); - $this->assertInstanceOf('PHPCR\Query\QOM\EquiJoinConditionInterface', $qom->getSource()->getJoinCondition()); - $this->assertEquals(\PHPCR\Query\QOM\QueryObjectModelConstantsInterface::JCR_JOIN_TYPE_INNER, $qom->getSource()->getJoinType()); - } -} \ No newline at end of file