wiki.techinc.nl/tests/phpunit/includes/specials/ImageListPagerTest.php
Umherirrender 3cc880e271 Inject services into SpecialListFiles
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: Id68ce71805bcc7078043ee9438bae84f5dc5fce8
2020-10-16 19:01:01 +02:00

38 lines
950 B
PHP

<?php
use MediaWiki\MediaWikiServices;
/**
* Test class for ImageListPagerTest class.
*
* Copyright © 2013, Antoine Musso
* Copyright © 2013, Siebrand Mazeland
* Copyright © 2013, Wikimedia Foundation Inc.
*
* @group Database
*/
class ImageListPagerTest extends MediaWikiIntegrationTestCase {
/**
* @covers ImageListPager::formatValue
*/
public function testFormatValuesThrowException() {
$services = MediaWikiServices::getInstance();
$page = new ImageListPager(
RequestContext::getMain(),
null,
'',
false,
false,
$services->getLinkRenderer(),
$services->getRepoGroup(),
$services->getPermissionManager(),
$services->getDBLoadBalancer(),
$services->getCommentStore(),
$services->getActorMigration(),
UserCache::singleton()
);
$this->expectException( MWException::class );
$this->expectExceptionMessage( "invalid_field" );
$page->formatValue( 'invalid_field', 'invalid_value' );
}
}