public function testGetImmediateEmptyQueryResultForLimitLessThanOne()
 {
     $connection = $this->getMockBuilder('\\SMW\\MediaWiki\\Database')->disableOriginalConstructor()->getMock();
     $this->store->expects($this->never())->method('getConnection')->will($this->returnValue($connection));
     $this->querySegmentListBuilder->expects($this->any())->method('getErrors')->will($this->returnValue(array()));
     $description = $this->getMockForAbstractClass('\\SMW\\Query\\Language\\Description');
     $instance = new QueryEngine($this->store, $this->querySegmentListBuilder, $this->querySegmentListProcessor, $this->engineOptions);
     $query = new Query($description);
     $query->setUnboundLimit(-1);
     $this->assertInstanceOf('\\SMWQueryResult', $instance->getQueryResult($query));
 }
Пример #2
0
 public function testGetQueryResultForDebugQueryMode()
 {
     $connection = $this->getMockBuilder('\\SMW\\MediaWiki\\Database')->disableOriginalConstructor()->getMock();
     $this->store->expects($this->any())->method('getConnection')->will($this->returnValue($connection));
     $this->querySegmentListBuilder->expects($this->any())->method('getErrors')->will($this->returnValue(array()));
     $this->querySegmentListProcessor->expects($this->any())->method('getListOfResolvedQueries')->will($this->returnValue(array()));
     $description = $this->getMockForAbstractClass('\\SMW\\Query\\Language\\Description');
     $instance = new QueryEngine($this->store, $this->querySegmentListBuilder, $this->querySegmentListProcessor, $this->engineOptions);
     $query = new Query($description);
     $query->querymode = Query::MODE_DEBUG;
     $this->assertInternalType('string', $instance->getQueryResult($query));
 }
 /**
  * @since 2.2
  *
  * @return array
  */
 public function getErrors()
 {
     return $this->queryEngine->getQuerySegmentListBuilder()->getErrors();
 }