Passed
Pull Request — master (#17)
by
unknown
02:39
created

SimpleBatchUploadTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testgetMaxFilesPerBatch() 0 8 1
A setUp() 0 4 1
1
<?php
2
3
namespace SimpleBatchUpload;
4
5
/**
6
 * Class SimpleBatchUploadTest
7
 * @package SimpleBatchUpload
8
 * @group   Database
9
 */
10
class SimpleBatchUploadTest extends \MediaWikiTestCase {
0 ignored issues
show
Bug introduced by
The type MediaWikiTestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
12
	private $testConfig = [
13
		'*' => 1,
14
		'user' => 2,
15
		'sysop' => 3
16
	];
17
18
	protected function setUp() {
19
		parent::setUp();
20
		$this->setMwGlobals( [
21
			'wgSimpleBatchUploadMaxFilesPerBatch' => $this->testConfig
22
		] );
23
	}
24
25
	/**
26
	 * @covers SimpleBatchUpload\SimpleBatchUpload::getMaxFilesPerBatch
27
	 */
28
	public function testgetMaxFilesPerBatch() {
29
		$sbu = new SimpleBatchUpload();
30
		$this->assertEquals( $this->testConfig, $sbu->getMaxFilesPerBatch() );
31
		$testConfig = [
32
			'*' => 999
33
		];
34
		$sbu->setMaxFilesPerBatch( $testConfig );
35
		$this->assertEquals( $testConfig, $sbu->getMaxFilesPerBatch() );
36
	}
37
38
}
39