wiki.techinc.nl/tests/phpunit/includes/specials/SpecialLogTest.php
Alexander Vorwerk fd094c5bb7 Inject UserIdentityLookup into SpecialLog
Change-Id: Ifc17a7ef38da60ec1534b39df1657f2394cbcb59
2021-09-25 18:36:37 +02:00

41 lines
849 B
PHP

<?php
/**
* @license GPL-2.0-or-later
* @author Legoktm
*/
/**
* @covers SpecialLog
*/
class SpecialLogTest extends SpecialPageTestBase {
/**
* Returns a new instance of the special page under test.
*
* @return SpecialPage
*/
protected function newSpecialPage() {
$services = $this->getServiceContainer();
return new SpecialLog(
$services->getLinkBatchFactory(),
$services->getDBLoadBalancer(),
$services->getActorNormalization(),
$services->getUserIdentityLookup()
);
}
/**
* 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 );
}
}