Passed
Push — master ( 8ff373...315bd9 )
by adam
01:44
created

StringValueParserTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A invalidInputProvider() 0 10 1
A testSetAndGetOptions() 0 7 1
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace ValueParsers\Tests;
6
7
use ValueParsers\ParserOptions;
8
use ValueParsers\StringValueParser;
9
10
/**
11
 * @covers \ValueParsers\StringValueParser
12
 *
13
 * @group ValueParsers
14
 * @group DataValueExtensions
15
 *
16
 * @license GPL-2.0-or-later
17
 * @author Jeroen De Dauw < [email protected] >
18
 */
19
abstract class StringValueParserTest extends ValueParserTestBase {
20
21
	/**
22
	 * @see ValueParserTestBase::invalidInputProvider
23
	 */
24
	public function invalidInputProvider() {
25
		return [
26
			[ true ],
27
			[ false ],
28
			[ null ],
29
			[ 4.2 ],
30
			[ [] ],
31
			[ 42 ],
32
		];
33
	}
34
35
	public function testSetAndGetOptions() {
36
		/** @var StringValueParser $parser */
37
		$parser = $this->getInstance();
38
		$options = new ParserOptions();
39
		$parser->setOptions( $options );
40
		$this->assertSame( $options, $parser->getOptions() );
41
	}
42
43
}
44