Completed
Branch feature/scrutinizer (5874ea)
by X
03:07
created

NullParserTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A provideInvalidData() 0 17 1
A testParseFailure() 0 6 1
1
<?php
2
3
namespace xKerman\Restricted\Test;
4
5
use PHPUnit\Framework\TestCase;
6
7
use xKerman\Restricted\NullParser;
8
use xKerman\Restricted\Source;
9
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