1 | <?php |
||
24 | abstract class ValueParserTestBase extends TestCase { |
||
25 | |||
26 | /** |
||
27 | * @return array[] |
||
28 | */ |
||
29 | abstract public function validInputProvider(); |
||
30 | |||
31 | /** |
||
32 | * @return array[] |
||
33 | */ |
||
34 | abstract public function invalidInputProvider(); |
||
35 | |||
36 | /** |
||
37 | * @return ValueParser |
||
38 | */ |
||
39 | abstract protected function getInstance(); |
||
40 | |||
41 | /** |
||
42 | * @dataProvider validInputProvider |
||
43 | * @param mixed $value |
||
44 | * @param mixed $expected |
||
45 | * @param ValueParser|null $parser |
||
46 | */ |
||
47 | public function testParseWithValidInputs( $value, $expected, ValueParser $parser = null ) { |
||
54 | |||
55 | /** |
||
56 | * @param DataValue|mixed $expected |
||
57 | * @param DataValue|mixed $actual |
||
58 | */ |
||
59 | private function assertSmartEquals( $expected, $actual ) { |
||
74 | |||
75 | /** |
||
76 | * @dataProvider invalidInputProvider |
||
77 | * @param mixed $value |
||
78 | * @param ValueParser|null $parser |
||
79 | */ |
||
80 | public function testParseWithInvalidInputs( $value, ValueParser $parser = null ) { |
||
88 | |||
89 | /** |
||
90 | * Returns if the result of the parsing process should be checked to be a DataValue. |
||
91 | * |
||
92 | * @return bool |
||
93 | */ |
||
94 | protected function requireDataValue() { |
||
97 | |||
98 | } |
||
99 |