wiki.techinc.nl/tests/phpunit/includes/specials/SpecialLogTest.php
Umherirrender 7d14ded394 Inject services into SpecialLog
This covers only directly used services by this special page and pager
Services used by the base class are not part of this patch set

Bug: T259960
Change-Id: Ib4b5edf6b4c56ef626875df8d95496225cddf501
2020-10-26 16:25:17 +00:00

43 lines
882 B
PHP

<?php
/**
* @license GPL-2.0-or-later
* @author Legoktm
*/
use MediaWiki\MediaWikiServices;
/**
* @covers SpecialLog
*/
class SpecialLogTest extends SpecialPageTestBase {
/**
* Returns a new instance of the special page under test.
*
* @return SpecialPage
*/
protected function newSpecialPage() {
$services = MediaWikiServices::getInstance();
return new SpecialLog(
$services->getPermissionManager(),
$services->getLinkBatchFactory(),
$services->getDBLoadBalancer(),
$services->getActorMigration()
);
}
/**
* Verify that no exception was thrown for an invalid date
* @see T201411
*/
public function testInvalidDate() {
list( $html, ) = $this->executeSpecialPage(
'',
// There is no 13th month
new FauxRequest( [ 'wpdate' => '2018-13-01' ] ),
'qqx'
);
$this->assertStringContainsString( '(log-summary)', $html );
}
}