public function descriptionProvider() { $descriptionFactory = new DescriptionFactory(); #0 Disjunction $description = $descriptionFactory->newDisjunction(); $description->addDescription($descriptionFactory->newNamespaceDescription(NS_HELP)); $description->addDescription($descriptionFactory->newNamespaceDescription(NS_MAIN)); $expectedDisjunction = new \stdClass(); $expectedDisjunction->type = 3; $expectedDisjunction->components = array(1 => true, 2 => true); $provider[] = array($description, $expectedDisjunction); #1 Conjunction $description = $descriptionFactory->newConjunction(); $description->addDescription($descriptionFactory->newNamespaceDescription(NS_HELP)); $description->addDescription($descriptionFactory->newNamespaceDescription(NS_MAIN)); $expectedConjunction = new \stdClass(); $expectedConjunction->type = 4; $expectedConjunction->components = array(1 => true, 2 => true); $provider[] = array($description, $expectedConjunction); #2 No query $description = $descriptionFactory->newConjunction(); $description->addDescription($descriptionFactory->newThingDescription()); $expectedConjunction = new \stdClass(); $expectedConjunction->type = 0; $expectedConjunction->components = array(); $provider[] = array($description, $expectedConjunction); return $provider; }
public function testCanConstructNamespaceDescription() { $instance = new DescriptionFactory(); $this->assertInstanceOf('SMW\\Query\\Language\\NamespaceDescription', $instance->newNamespaceDescription(SMW_NS_PROPERTY)); }