Use SpecialPageFactory in SpecialNukeTest

Core's SpecialLog is not @newable, therefore the constructor
may change without notice (which has apparently happened
in 07db710).

Change-Id: I91964bcd787201c89c5eb6f623daba86d8d28d3e
This commit is contained in:
Matěj Suchánek 2024-08-12 18:52:46 +02:00
parent bad287793a
commit 68269df6ea

View file

@ -5,7 +5,6 @@ namespace MediaWiki\Extension\Nuke\Test\Integration;
use MediaWiki\Extension\Nuke\SpecialNuke; use MediaWiki\Extension\Nuke\SpecialNuke;
use MediaWiki\Permissions\UltimateAuthority; use MediaWiki\Permissions\UltimateAuthority;
use MediaWiki\Request\FauxRequest; use MediaWiki\Request\FauxRequest;
use MediaWiki\Specials\SpecialLog;
use MediaWiki\Title\Title; use MediaWiki\Title\Title;
use PermissionsError; use PermissionsError;
use SpecialPageTestBase; use SpecialPageTestBase;
@ -624,13 +623,7 @@ class SpecialNukeTest extends SpecialPageTestBase {
private function getDeleteLogHtml(): string { private function getDeleteLogHtml(): string {
$services = $this->getServiceContainer(); $services = $this->getServiceContainer();
$specialLog = new SpecialLog( $specialLog = $services->getSpecialPageFactory()->getPage( 'Log' );
$services->getLinkBatchFactory(),
$services->getConnectionProvider(),
$services->getActorNormalization(),
$services->getUserIdentityLookup(),
$services->getUserNameUtils()
);
$specialLog->execute( "delete" ); $specialLog->execute( "delete" );
return $specialLog->getOutput()->getHTML(); return $specialLog->getOutput()->getHTML();
} }