1 | <?php |
||
10 | class NullParserTest extends TestCase |
||
11 | { |
||
12 | public function provideInvalidData() |
||
13 | { |
||
14 | return [ |
||
15 | 'empty string' => [ |
||
16 | 'input' => '', |
||
17 | ], |
||
18 | 'not null' => [ |
||
19 | 'input' => 'i:0;', |
||
20 | ], |
||
21 | 'missing tag' => [ |
||
22 | 'input' => ';', |
||
23 | ], |
||
24 | 'missing semicolon' => [ |
||
25 | 'input' => 'N', |
||
26 | ], |
||
27 | ]; |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @covers \xKerman\Restricted\NullParser |
||
32 | * @dataProvider provideInvalidData |
||
33 | * @expectedException \xKerman\Restricted\UnserializeFailedException |
||
34 | */ |
||
35 | public function testParseFailure($input) |
||
36 | { |
||
37 | $source = new Source($input); |
||
38 | $parser = new NullParser(); |
||
39 | $parser->parse($source); |
||
40 | } |
||
41 | } |
||
42 |