当前位置: 首页>>代码示例>>PHP>>正文


PHP SMWQuery::setUnboundLimit方法代码示例

本文整理汇总了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());
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:10,代码来源:QueryTest.php

示例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));
 }
开发者ID:WolfgangFahl,项目名称:SemanticMediaWiki,代码行数:11,代码来源:QueryEngineTest.php

示例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));
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:14,代码来源:QueryResultDependencyListResolverTest.php

示例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));
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:13,代码来源:QueryEngineTest.php

示例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));
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:9,代码来源:PageTypeRegexQueryTest.php


注:本文中的SMWQuery::setUnboundLimit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。