SettingsTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 29
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A constructorProvider() 0 10 1
A testConstructor() 0 9 2
1
<?php
2
3
namespace ParamProcessor\Tests\Unit;
4
5
use ParamProcessor\Settings;
6
use PHPUnit\Framework\TestCase;
7
8
/**
9
 * @covers \ParamProcessor\Settings
10
 *
11
 * @licence GNU GPL v2+
12
 * @author Jeroen De Dauw < [email protected] >
13
 */
14
class SettingsTest extends TestCase {
15
16
	public function constructorProvider() {
17
		$settingArrays = [
18
			[ [] ],
19
			[ [ 'foo' => 'bar' ] ],
20
			[ [ 'foo' => 'bar', 'baz' => 'BAH' ] ],
21
			[ [ '~[,,_,,]:3' => [ 9001, 4.2 ] ] ],
22
		];
23
24
		return $settingArrays;
25
	}
26
27
	/**
28
	 * @dataProvider constructorProvider
29
	 *
30
	 * @param array $settings
31
	 */
32
	public function testConstructor( array $settings ) {
33
		$settingsObject = new Settings( $settings );
0 ignored issues
show
Deprecated Code introduced by
The class ParamProcessor\Settings has been deprecated with message: since 1.7

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
34
35
		foreach ( $settings as $name => $value ) {
36
			$this->assertEquals( $value, $settingsObject->get( $name ) );
37
		}
38
39
		$this->assertTrue( true );
40
	}
41
42
}
43