summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/Translate/tests/phpunit/ResourcesOrderTest.php
blob: 0f265201709309997043ba174fef849aac82a4dc (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
<?php
/**
 * Code hygiene test.
 *
 * @file
 * @author Niklas Laxström
 * @copyright Copyright © 2012-2013, Niklas Laxström
 * @license GPL-2.0+
 */

class ResourcesOrderTest extends MediaWikiTestCase {
	public function setUp() {
		parent::setUp();
		$this->setMwGlobals( 'wgResourceModules', array() );
	}

	public function testAlphabeticalOrder() {
		require __DIR__ . '/../../Resources.php';

		$sorted = $wgResourceModules;
		ksort( $sorted );

		$this->assertEquals(
			array_keys( $sorted ),
			array_keys( $wgResourceModules ),
			'Modules are defined in alphabetical order.'
		);
	}
}