mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-12-22 20:52:43 +00:00
fe449821c8
Use $this->getServiceContainer() instead of MediaWikiServices::getInstance() in tests. Change-Id: Id614ed8948fff75991ecf2c805707bc7f16f36a6
35 lines
843 B
PHP
35 lines
843 B
PHP
<?php
|
|
|
|
/**
|
|
* Copy of CentralAuth's CentralAuthServiceWiringTest.php
|
|
* used to test the ServiceWiring.php file.
|
|
*/
|
|
|
|
namespace MediaWiki\Skins\Vector\Tests\Integration;
|
|
|
|
use MediaWikiIntegrationTestCase;
|
|
|
|
/**
|
|
* Partly Tests ServiceWiring.php by ensuring that the call to the
|
|
* service does not result in an error.
|
|
*
|
|
* @coversNothing PHPUnit does not support covering annotations for files
|
|
* @group Vector
|
|
*/
|
|
class ServiceWiringTest extends MediaWikiIntegrationTestCase {
|
|
/**
|
|
* @dataProvider provideService
|
|
*/
|
|
public function testService( string $name ) {
|
|
$this->getServiceContainer()->get( $name );
|
|
$this->addToAssertionCount( 1 );
|
|
}
|
|
|
|
public static function provideService() {
|
|
$wiring = require __DIR__ . '/../../../includes/ServiceWiring.php';
|
|
foreach ( $wiring as $name => $_ ) {
|
|
yield $name => [ $name ];
|
|
}
|
|
}
|
|
}
|