mediawiki-extensions-Math/tests/phpunit/unit/ServiceWiringTest.php
Umherirrender 7a8d5b9dc4 tests: Make some PHPUnit data providers static
Initally used a new sniff with autofix (T333745)

Bug: T332865
Change-Id: I73d2903fed7523826b71fc452a846dc4c6e85802
2023-05-21 11:00:48 +02:00

31 lines
667 B
PHP

<?php
namespace MediaWiki\Extension\Math\Tests;
use Generator;
use MediaWikiUnitTestCase;
/**
* @coversNothing
*/
class ServiceWiringTest extends MediaWikiUnitTestCase {
private const EXTENSION_PREFIX = 'Math.';
/**
* @dataProvider provideWiring
*/
public function testAllWiringsAreProperlyShaped( $name, $definition ): void {
$this->assertStringStartsWith( self::EXTENSION_PREFIX, $name );
$this->assertIsCallable( $definition );
}
public static function provideWiring(): Generator {
$wiring = require __DIR__ . '/../../../ServiceWiring.php';
foreach ( $wiring as $name => $definition ) {
yield $name => [ $name, $definition ];
}
}
}