Completed
Push — master ( 5b92bc...3eff9f )
by Jeroen De
02:33
created

StringParamTest::valueProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 9.6666
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace ParamProcessor\Tests\Unit\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