public function testGetHierarchyTableDefinitionForType()
 {
     $this->connection->expects($this->once())->method('tableName')->with($this->stringContains('bar'))->will($this->returnValue('_bar'));
     $instance = new HierarchyTempTableBuilder($this->connection, $this->temporaryIdTableCreator);
     $instance->setPropertyHierarchyTableDefinition('bar', 3);
     $this->assertEquals(array('_bar', 3), $instance->getHierarchyTableDefinitionForType('property'));
 }
 /**
  * @since 2.2
  *
  * @return QueryEngine
  */
 public function newMasterQueryEngine()
 {
     $hierarchyTempTableBuilder = new HierarchyTempTableBuilder($this->store->getConnection('mw.db'), $this->newTemporaryIdTableCreator());
     $hierarchyTempTableBuilder->setPropertyHierarchyTableDefinition($this->store->findPropertyTableID(new DIProperty('_SUBP')), $GLOBALS['smwgQSubpropertyDepth']);
     $hierarchyTempTableBuilder->setClassHierarchyTableDefinition($this->store->findPropertyTableID(new DIProperty('_SUBC')), $GLOBALS['smwgQSubcategoryDepth']);
     $querySegmentListProcessor = new QuerySegmentListProcessor($this->store->getConnection('mw.db'), $this->newTemporaryIdTableCreator(), $hierarchyTempTableBuilder);
     return new QueryEngine($this->store, new QuerySegmentListBuilder($this->store), $querySegmentListProcessor, new EngineOptions());
 }
 /**
  * @since 2.4
  *
  * @return QuerySegmentListProcessor
  */
 public function newQuerySegmentListProcessor()
 {
     $connection = $this->store->getConnection('mw.db.queryengine');
     $temporaryTableBuilder = $this->newTemporaryTableBuilder();
     $hierarchyTempTableBuilder = new HierarchyTempTableBuilder($connection, $temporaryTableBuilder);
     $hierarchyTempTableBuilder->setPropertyHierarchyTableDefinition($this->store->findPropertyTableID(new DIProperty('_SUBP')), $this->applicationFactory->getSettings()->get('smwgQSubpropertyDepth'));
     $hierarchyTempTableBuilder->setClassHierarchyTableDefinition($this->store->findPropertyTableID(new DIProperty('_SUBC')), $this->applicationFactory->getSettings()->get('smwgQSubcategoryDepth'));
     $querySegmentListProcessor = new QuerySegmentListProcessor($connection, $temporaryTableBuilder, $hierarchyTempTableBuilder);
     return $querySegmentListProcessor;
 }