public function testTryToFindDataItemOnInvalidUri()
 {
     $store = $this->getMockBuilder('\\SMW\\SPARQLStore\\SPARQLStore')->disableOriginalConstructor()->getMock();
     $instance = new DataItemByExpElementMatchFinder($store, 'http://example.org/id/');
     $expResource = $this->getMockBuilder('\\SMW\\Exporter\\Element\\ExpResource')->disableOriginalConstructor()->getMock();
     $expResource->expects($this->once())->method('getUri')->will($this->returnValue('_node1abjt1k9bx17'));
     $this->assertNull($instance->tryToFindDataItemForExpElement($expResource));
 }
예제 #2
0
 /**
  * Try to find an SMWDataItem that the given ExpElement might
  * represent. Returns null if this attempt failed.
  *
  * @param ExpElement $expElement
  * @return SMWDataItem or null
  */
 public function findDataItemForExpElement(ExpElement $expElement)
 {
     return self::$dataItemByExpElementMatchFinder->tryToFindDataItemForExpElement($expElement);
 }