mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-28 09:30:17 +00:00
9d265af32f
Test ServiceWiring.php using tests copied from CentralAuth. Because phpunit does not support marking a file as covered, the file is marked as ignored for code coverage. However, these tests do not fully cover the single service as these tests only verify that the call to the service does not result in an error. Change-Id: I6100d242aa61975cab7c44b35616cb2b19762cbf
36 lines
873 B
PHP
36 lines
873 B
PHP
<?php
|
|
|
|
/**
|
|
* Copy of CentralAuth's CentralAuthServiceWiringTest.php
|
|
* used to test the ServiceWiring.php file.
|
|
*/
|
|
|
|
namespace MediaWiki\Skins\Vector\Tests\Integration;
|
|
|
|
use MediaWiki\MediaWikiServices;
|
|
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 ) {
|
|
MediaWikiServices::getInstance()->get( $name );
|
|
$this->addToAssertionCount( 1 );
|
|
}
|
|
|
|
public function provideService() {
|
|
$wiring = require __DIR__ . '/../../../includes/ServiceWiring.php';
|
|
foreach ( $wiring as $name => $_ ) {
|
|
yield $name => [ $name ];
|
|
}
|
|
}
|
|
}
|