本文整理汇总了PHP中SMWQuery::setUnboundLimit方法的典型用法代码示例。如果您正苦于以下问题:PHP SMWQuery::setUnboundLimit方法的具体用法?PHP SMWQuery::setUnboundLimit怎么用?PHP SMWQuery::setUnboundLimit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SMWQuery
的用法示例。
在下文中一共展示了SMWQuery::setUnboundLimit方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSetGetLimitForUpperboundWhereLimitIsUnrestricted
public function testSetGetLimitForUpperboundWhereLimitIsUnrestricted()
{
$description = $this->getMockForAbstractClass('\\SMW\\Query\\Language\\Description');
$instance = new Query($description, Query::INLINE_QUERY);
$upperboundLimit = 999999999;
$this->assertLessThan($upperboundLimit, $this->smwgQMaxLimit);
$this->assertLessThan($upperboundLimit, $this->smwgQMaxInlineLimit);
$instance->setUnboundLimit($upperboundLimit);
$this->assertEquals($upperboundLimit, $instance->getLimit());
}
示例2: testGetImmediateEmptyQueryResultForLimitLessThanOne
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));
}
示例3: testTryTogetDependencyListFromForLimitZeroQuery
public function testTryTogetDependencyListFromForLimitZeroQuery()
{
$subject = DIWikiPage::newFromText('Foo');
$description = $this->getMockBuilder('\\SMW\\Query\\Language\\Description')->disableOriginalConstructor()->getMock();
$query = new Query($description);
$query->setContextPage($subject);
$query->setUnboundLimit(0);
$queryResult = $this->getMockBuilder('\\SMWQueryResult')->disableOriginalConstructor()->getMock();
$queryResult->expects($this->any())->method('getQuery')->will($this->returnValue($query));
$queryResult->expects($this->never())->method('getStore')->will($this->returnValue($this->store));
$propertyHierarchyLookup = $this->getMockBuilder('\\SMW\\PropertyHierarchyLookup')->disableOriginalConstructor()->getMock();
$instance = new QueryResultDependencyListResolver($propertyHierarchyLookup);
$this->assertEmpty($instance->getDependencyListFrom($queryResult));
}
示例4: testGetImmediateEmptyQueryResultForLimitLessThanOne
public function testGetImmediateEmptyQueryResultForLimitLessThanOne()
{
$repositoryResult = $this->getMockBuilder('\\SMW\\SPARQLStore\\QueryEngine\\RepositoryResult')->disableOriginalConstructor()->getMock();
$connection = $this->getMockBuilder('\\SMW\\SPARQLStore\\RepositoryConnection')->disableOriginalConstructor()->getMockForAbstractClass();
$store = $this->getMockBuilder('\\SMW\\SPARQLStore\\SPARQLStore')->disableOriginalConstructor()->getMock();
$compoundConditionBuilder = $this->getMockBuilder('\\SMW\\SPARQLStore\\QueryEngine\\CompoundConditionBuilder')->disableOriginalConstructor()->getMock();
$compoundConditionBuilder->expects($this->never())->method('setSortKeys')->will($this->returnValue($compoundConditionBuilder));
$description = $this->getMockForAbstractClass('\\SMW\\Query\\Language\\Description');
$instance = new QueryEngine($connection, $compoundConditionBuilder, new QueryResultFactory($store));
$query = new Query($description);
$query->setUnboundLimit(-1);
$this->assertInstanceOf('\\SMWQueryResult', $instance->getQueryResult($query));
}
示例5: assertThatQueryReturns
private function assertThatQueryReturns($queryString, $expected)
{
$description = $this->queryParser->getQueryDescription($queryString);
$query = new Query($description, false, true);
$query->sort = true;
$query->sortkeys = array('Title' => 'desc');
$query->setUnboundLimit(1000);
$this->queryResultValidator->assertThatQueryResultHasSubjects($expected, $this->getStore()->getQueryResult($query));
}