本文整理汇总了PHP中SearchEngine::searchText方法的典型用法代码示例。如果您正苦于以下问题:PHP SearchEngine::searchText方法的具体用法?PHP SearchEngine::searchText怎么用?PHP SearchEngine::searchText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SearchEngine
的用法示例。
在下文中一共展示了SearchEngine::searchText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAugmentorSearch
public function testAugmentorSearch()
{
$this->search->setNamespaces([0, 1, 4]);
$resultSet = $this->search->searchText('smithee');
// Not using mock since PHPUnit mocks do not work properly with references in params
$this->mergeMwGlobalArrayValue('wgHooks', ['SearchResultsAugment' => [[$this, 'addAugmentors']]]);
$this->search->augmentSearchResults($resultSet);
for ($result = $resultSet->next(); $result; $result = $resultSet->next()) {
$id = $result->getTitle()->getArticleID();
$augmentData = "Result:{$id}:" . $result->getTitle()->getText();
$augmentData2 = "Result2:{$id}:" . $result->getTitle()->getText();
$this->assertEquals(['testSet' => $augmentData, 'testRow' => $augmentData2], $result->getExtensionData());
}
}
示例2: testTextPowerSearch
public function testTextPowerSearch()
{
$this->search->setNamespaces(array(0, 1, 4));
$this->assertEquals(array('Smithee', 'Talk:Not Main Page'), $this->fetchIds($this->search->searchText('smithee')), "Power search failed");
}