SettingsTest::testConstructor()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 2
nc 2
nop 1
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