SetupTest::testCanConstruct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 14
rs 9.7998
c 0
b 0
f 0
1
<?php
2
3
namespace GitHub\Tests\Phpunit;
4
5
use GitHub\Setup;
6
use GitHub\Tests\MediaWikiBoundTestCase;
7
8
/**
9
 * @covers \GitHub\Setup
10
 *
11
 * @licence GNU GPL v2+
12
 * @author Jeroen De Dauw < [email protected] >
13
 */
14
class SetupTest extends MediaWikiBoundTestCase {
15
16
	public function testCanConstruct() {
17
		$inputGlobals = [
18
			'wgExtensionCredits' => [ 'other' => [] ],
19
			'wgHooks' => [ 'ParserFirstCallInit' => [] ],
20
		];
21
22
		$setup = new Setup( $inputGlobals, __DIR__ . '/..' );
23
		$setup->run();
24
25
		$this->assertCount( 1, $inputGlobals['wgExtensionCredits']['other'], 'credits where set' );
26
		$this->assertCount( 1, $inputGlobals['wgHooks']['ParserFirstCallInit'], 'parser hook was registered' );
27
28
		$setup->getGitHubHookHandler();
29
	}
30
31
}
32