10 $result = SearchResult::newFromTitle( Title::newMainPage() );
12 $this->assertEquals( 1, $resultSet->numRows() );
14 foreach ( $resultSet as $iterResult ) {
15 $this->assertEquals( $result, $iterResult );
18 $this->assertEquals( 1, $count );
24 while (
false !== ( $iterResult = $resultSet->next() ) ) {
25 $this->assertEquals( $result, $iterResult );
28 $this->assertEquals( 1, $count );
36 $result = SearchResult::newFromTitle( Title::newMainPage() );
38 $resultSet->augmentResult( $result );
39 $this->assertEquals( [], $result->getExtensionData() );
40 $resultSet->setAugmentedData(
'foo', [
41 $result->getTitle()->getArticleID() =>
'bar'
43 $this->assertEquals( [
'foo' =>
'bar' ], $result->getExtensionData() );
52 $result = SearchResult::newFromTitle( Title::newMainPage() );
54 $this->assertEquals( 3, count( $resultSet ) );
55 $this->assertFalse( $resultSet->hasMoreResults() );
56 $resultSet->shrink( 3 );
57 $this->assertFalse( $resultSet->hasMoreResults() );
58 $resultSet->shrink( 2 );
59 $this->assertTrue( $resultSet->hasMoreResults() );