Passed
Push — master ( 761e95...f1e6ba )
by Jeroen De
05:40
created

StringParamTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 48
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDefinitions() 0 7 1
A valueProvider() 0 18 1
A getType() 0 3 1
1
<?php
2
3
namespace ParamProcessor\Tests\Integration\Definitions;
4
5
/**
6
 * @licence GNU GPL v2+
7
 * @author Jeroen De Dauw < [email protected] >
8
 */
9
class StringParamTest extends ParamDefinitionTest {
10
11
	/**
12
	 * @see ParamDefinitionTest::getDefinitions
13
	 */
14
	public function getDefinitions() {
15
		$params = parent::getDefinitions();
16
17
18
19
		return $params;
20
	}
21
22
	/**
23
	 * @see ParamDefinitionTest::valueProvider
24
	 *
25
	 * @param boolean $stringlyTyped
26
	 *
27
	 * @return array
28
	 */
29
	public function valueProvider( $stringlyTyped = true ) {
30
		return [
31
			'empty' => [
32
				[ 'ohi there', true, 'ohi there' ],
33
				[ 4.2, false ],
34
				[ [ 42 ], false ],
35
			],
36
			'values' => [
37
				[ 'foo', true, 'foo' ],
38
				[ '1', true, '1' ],
39
				[ 'yes', true, 'yes' ],
40
				[ 'bar', false ],
41
				[ true, false ],
42
				[ 0.1, false ],
43
				[ [], false ],
44
			],
45
		];
46
	}
47
48
	/**
49
	 * @see ParamDefinitionTest::getType
50
	 * @return string
51
	 */
52
	public function getType() {
53
		return 'string';
54
	}
55
56
}
57