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

SimpleBatchUploadTest::testgetMaxFilesPerBatch()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 8
rs 10
c 0
b 0
f 0
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() );
0 ignored issues
show
Bug introduced by
The method getMaxFilesPerBatch() does not exist on SimpleBatchUpload\SimpleBatchUpload. Did you maybe mean getMaxFilesPerBatchConfig()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

30
		$this->assertEquals( $this->testConfig, $sbu->/** @scrutinizer ignore-call */ getMaxFilesPerBatch() );

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
31
		$testConfig = [
32
			'*' => 999
33
		];
34
		$sbu->setMaxFilesPerBatch( $testConfig );
0 ignored issues
show
Bug introduced by
The method setMaxFilesPerBatch() does not exist on SimpleBatchUpload\SimpleBatchUpload. Did you maybe mean setMaxFilesPerBatchConfig()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

34
		$sbu->/** @scrutinizer ignore-call */ 
35
        setMaxFilesPerBatch( $testConfig );

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
35
		$this->assertEquals( $testConfig, $sbu->getMaxFilesPerBatch() );
36
	}
37
38
}
39