summaryrefslogtreecommitdiff
blob: c5cca12e33dc41467f3155145754fb3cd475b954 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
declare( strict_types = 1 );

use MediaWiki\Extensions\Translate\Services;

/**
 * @author Niklas Laxström
 * @license GPL-2.0-or-later
 * @covers \MediaWiki\Extensions\Translate\Services
 */
class ServicesTest extends MediaWikiIntegrationTestCase {
	public function testNoExceptions() {
		$services = Services::getInstance();
		$class = new ReflectionClass( Services::class );
		$reflectionMethods = $class->getMethods( ReflectionMethod::IS_PUBLIC );
		$methods = [];
		foreach ( $reflectionMethods as $methodObj ) {
			$method = $methodObj->getName();
			if ( !$methodObj->isStatic() && preg_match( '/^get[A-Z]/', $method ) ) {
				$methods[] = $method;
			}
		}

		foreach ( $methods as $method ) {
			$services->$method();
		}

		$this->assertTrue( true, 'All services can be constructed' );
	}
}