for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SIL\Tests\Search;
use SIL\Search\MappedSearchResultSet;
use SMW\DIProperty;
/**
* @covers \SIL\Search\MappedSearchResultSet
*
* @group semantic-interlanguage-links
* @license GNU GPL v2+
* @since 1.0
* @author mwjames
*/
class MappedSearchResultSetTest extends \PHPUnit_Framework_TestCase {
protected function setUp() : void {
$this->markTestSkipped( 'The each() function is deprecated. This message will be suppressed on further calls' );
}
public function testCanConstruct() {
$searchMatches = [];
$termMatches = [];
$this->assertInstanceOf(
'\SIL\Search\MappedSearchResultSet',
new MappedSearchResultSet( $searchMatches, $termMatches )
);
public function testEmptyResulSet() {
$instance = new MappedSearchResultSet( $searchMatches, $termMatches, 42 );
$this->assertEquals(
0,
$instance->numRows()
$this->assertFalse(
$instance->hasResults()
42,
$instance->getTotalHits()
$this->assertEmpty(
$instance->termMatches()
$instance->next()
public function testNextSearchResult() {
$searchResult = $this->getMockBuilder( '\SearchResult' )
->disableOriginalConstructor()
->getMock();
$fakeTitle = $this->getMockBuilder( '\Title' )
$searchMatches = [ $searchResult, $fakeTitle, 'Foo' ];
$instance = new MappedSearchResultSet( $searchMatches, $termMatches );
$searchResult,
'\SearchResult',