public function testTextAlreadyUpdatedForIndex() { if (!method_exists('SearchEngine', 'textAlreadyUpdatedForIndex')) { $this->markTestSkipped('SearchEngine::textAlreadyUpdatedForIndex() is undefined. Probably not yet present in the tested MW version.'); } $searchEngine = $this->getMockBuilder('SearchEngine')->disableOriginalConstructor()->getMock(); $searchEngine->expects($this->once())->method('textAlreadyUpdatedForIndex')->with()->will($this->returnValue(true)); $search = new Search(); $search->setFallbackSearchEngine($searchEngine); $this->assertTrue($search->textAlreadyUpdatedForIndex('Some text')); }