forked from DataValues/Common
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNullParserTest.php
More file actions
60 lines (52 loc) · 1.26 KB
/
NullParserTest.php
File metadata and controls
60 lines (52 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
namespace ValueParsers\Test;
use DataValues\UnknownValue;
use ValueParsers\NullParser;
use ValueParsers\ValueParser;
/**
* @covers ValueParsers\NullParser
*
* @group ValueParsers
* @group DataValueExtensions
*
* @license GPL-2.0+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
class NullParserTest extends ValueParserTestBase {
/**
* @see ValueParserTestBase::getInstance
*
* @return NullParser
*/
protected function getInstance() {
return new NullParser();
}
/**
* @see ValueParserTestBase::validInputProvider
*/
public function validInputProvider() {
return [
[ '42', new UnknownValue( '42' ) ],
[ 42, new UnknownValue( 42 ) ],
[ false, new UnknownValue( false ) ],
[ [], new UnknownValue( [] ) ],
[ 'ohi there!', new UnknownValue( 'ohi there!' ) ],
[ null, new UnknownValue( null ) ],
[ 4.2, new UnknownValue( 4.2 ) ],
];
}
/**
* @see ValueParserTestBase::invalidInputProvider
*/
public function invalidInputProvider() {
return [ [ null ] ];
}
/**
* @see ValueParserTestBase::testParseWithInvalidInputs
*
* @dataProvider invalidInputProvider
*/
public function testParseWithInvalidInputs( $value, ValueParser $parser = null ) {
$this->markTestSkipped( 'NullParser has no invalid inputs' );
}
}