mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-15 18:19:38 +00:00
0f062fca06
Change-Id: I569281b13ec81d9f35038c7ef17a2d98f16f9b5c
66 lines
2.6 KiB
PHP
66 lines
2.6 KiB
PHP
<?php
|
|
|
|
use MediaWiki\Extension\AbuseFilter\View\AbuseFilterViewDiff;
|
|
use MediaWiki\Extension\AbuseFilter\View\AbuseFilterViewEdit;
|
|
use MediaWiki\Extension\AbuseFilter\View\AbuseFilterViewExamine;
|
|
use MediaWiki\Extension\AbuseFilter\View\AbuseFilterViewHistory;
|
|
use MediaWiki\Extension\AbuseFilter\View\AbuseFilterViewImport;
|
|
use MediaWiki\Extension\AbuseFilter\View\AbuseFilterViewList;
|
|
use MediaWiki\Extension\AbuseFilter\View\AbuseFilterViewRevert;
|
|
use MediaWiki\Extension\AbuseFilter\View\AbuseFilterViewTestBatch;
|
|
use MediaWiki\Extension\AbuseFilter\View\AbuseFilterViewTools;
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
class SpecialAbuseFilterIntegrationTest extends SpecialPageTestBase {
|
|
|
|
/**
|
|
* @covers SpecialAbuseFilter::instantiateView
|
|
* @covers SpecialAbuseFilter::__construct
|
|
* @covers \MediaWiki\Extension\AbuseFilter\View\AbuseFilterView::__construct
|
|
* @covers \MediaWiki\Extension\AbuseFilter\View\AbuseFilterViewDiff::__construct
|
|
* @covers \MediaWiki\Extension\AbuseFilter\View\AbuseFilterViewEdit::__construct
|
|
* @covers \MediaWiki\Extension\AbuseFilter\View\AbuseFilterViewExamine::__construct
|
|
* @covers \MediaWiki\Extension\AbuseFilter\View\AbuseFilterViewHistory::__construct
|
|
* @covers \MediaWiki\Extension\AbuseFilter\View\AbuseFilterViewImport::__construct
|
|
* @covers \MediaWiki\Extension\AbuseFilter\View\AbuseFilterViewList::__construct
|
|
* @covers \MediaWiki\Extension\AbuseFilter\View\AbuseFilterViewRevert::__construct
|
|
* @covers \MediaWiki\Extension\AbuseFilter\View\AbuseFilterViewTestBatch::__construct
|
|
* @covers \MediaWiki\Extension\AbuseFilter\View\AbuseFilterViewTools::__construct
|
|
* @dataProvider provideInstantiateView
|
|
*/
|
|
public function testInstantiateView( string $viewClass, array $params = [] ) {
|
|
$sp = $this->newSpecialPage();
|
|
$view = $sp->instantiateView( $viewClass, $params );
|
|
$this->assertInstanceOf( $viewClass, $view );
|
|
}
|
|
|
|
public function provideInstantiateView() : array {
|
|
return [
|
|
[ AbuseFilterViewDiff::class ],
|
|
[ AbuseFilterViewEdit::class, [ 'filter' => 1 ] ],
|
|
[ AbuseFilterViewExamine::class ],
|
|
[ AbuseFilterViewHistory::class ],
|
|
[ AbuseFilterViewImport::class ],
|
|
[ AbuseFilterViewList::class ],
|
|
[ AbuseFilterViewRevert::class ],
|
|
[ AbuseFilterViewTestBatch::class ],
|
|
[ AbuseFilterViewTools::class ],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
protected function newSpecialPage() : SpecialAbuseFilter {
|
|
$services = MediaWikiServices::getInstance();
|
|
$sp = new SpecialAbuseFilter(
|
|
$services->getObjectFactory()
|
|
);
|
|
$sp->setLinkRenderer(
|
|
$services->getLinkRendererFactory()->create()
|
|
);
|
|
return $sp;
|
|
}
|
|
|
|
}
|