public function testDisabledSubpropertyLookup() { $store = $this->getMockBuilder('\\SMW\\Store')->disableOriginalConstructor()->getMockForAbstractClass(); $cache = $this->getMockBuilder('\\Onoi\\Cache\\Cache')->disableOriginalConstructor()->getMock(); $cache->expects($this->never())->method('contains')->will($this->returnValue(false)); $instance = new PropertyHierarchyLookup($store, $cache); $instance->setSubpropertyDepth(0); $this->assertFalse($instance->hasSubpropertyFor(new DIProperty('Foo'))); }
private function doMatchProperty(&$subjects, DIProperty $property) { if ($property->isInverse()) { $property = new DIProperty($property->getKey()); } if ($this->propertyHierarchyLookup->hasSubpropertyFor($property)) { $this->doMatchSubproperty($subjects, $property); } $key = str_replace(' ', '_', $property->getKey()); if (!isset($this->propertyDependencyDetectionBlacklist[$key])) { $subjects[] = $property->getDiWikiPage(); } }
private function doMatchProperty(&$subjects, DIProperty $property) { if ($property->isInverse()) { $property = new DIProperty($property->getKey()); } $subject = $property->getCanonicalDiWikiPage(); if ($this->propertyHierarchyLookup->hasSubpropertyFor($property)) { $this->doMatchSubproperty($subjects, $subject, $property); } // Use the key here do match against pre-defined properties (e.g. _MDAT) $key = str_replace(' ', '_', $property->getKey()); if (!isset($this->propertyDependencyExemptionlist[$key])) { $subjects[$subject->getHash()] = $subject; } }