/**
  * @dataProvider descriptionProvider
  */
 public function testNamespaceCondition($description, $orderByProperty, $sortkeys, $expectedConditionType, $expectedConditionString)
 {
     $resultVariable = 'result';
     $compoundConditionBuilder = new CompoundConditionBuilder();
     $compoundConditionBuilder->setResultVariable($resultVariable);
     $compoundConditionBuilder->setSortKeys($sortkeys);
     $compoundConditionBuilder->setJoinVariable($resultVariable);
     $compoundConditionBuilder->setOrderByProperty($orderByProperty);
     $instance = new SomePropertyInterpreter($compoundConditionBuilder);
     $condition = $instance->interpretDescription($description);
     $this->assertInstanceOf($expectedConditionType, $condition);
     $this->assertEquals($expectedConditionString, $compoundConditionBuilder->convertConditionToString($condition));
 }
 public function testHierarchyPattern()
 {
     $property = new DIProperty('Foo');
     $propertyHierarchyExaminer = $this->getMockBuilder('\\SMW\\PropertyHierarchyExaminer')->disableOriginalConstructor()->getMock();
     $propertyHierarchyExaminer->expects($this->once())->method('hasSubpropertyFor')->with($this->equalTo($property))->will($this->returnValue(true));
     $resultVariable = 'result';
     $compoundConditionBuilder = new CompoundConditionBuilder();
     $compoundConditionBuilder->setPropertyHierarchyExaminer($propertyHierarchyExaminer);
     $compoundConditionBuilder->setResultVariable($resultVariable);
     $compoundConditionBuilder->setJoinVariable($resultVariable);
     $instance = new SomePropertyInterpreter($compoundConditionBuilder);
     $description = new SomeProperty($property, new ThingDescription());
     $condition = $instance->interpretDescription($description);
     $expected = UtilityFactory::getInstance()->newStringBuilder()->addString('?result ?sp2 ?v1 .')->addNewLine()->addString('{ ')->addNewLine()->addString('?sp2 rdfs:subPropertyOf* property:Foo .')->addNewLine()->addString('}')->addNewLine()->getString();
     $this->assertEquals($expected, $compoundConditionBuilder->convertConditionToString($condition));
 }