Passed
Push — test ( e89324...128558 )
by Tom
04:08
created

ParseExceptionTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 32
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetParseMessage() 0 3 1
A testThrowing() 0 6 1
A testCreation() 0 8 1
1
<?php
2
3
/* this file is part of pipelines */
4
5
namespace Ktomk\Pipelines\File;
6
7
use Ktomk\Pipelines\TestCase;
8
9
/**
10
 * @covers \Ktomk\Pipelines\File\ParseException
11
 */
12
class ParseExceptionTest extends TestCase
13
{
14
    /**
15
     * @return ParseException
16
     */
17
    public function testCreation()
18
    {
19
        $exception = new ParseException('message string');
20
        self::assertInstanceOf('Ktomk\Pipelines\File\ParseException', $exception);
21
        self::assertInstanceOf('InvalidArgumentException', $exception);
22
        self::assertInstanceOf('Exception', $exception);
23
24
        return $exception;
25
    }
26
27
    /**
28
     * @param ParseException $exception
29
     * @depends testCreation
30
     */
31
    public function testGetParseMessage(ParseException $exception)
32
    {
33
        self::assertIsString($exception->getParseMessage());
34
    }
35
36
    /**
37
     */
38
    public function testThrowing()
39
    {
40
        $this->expectException('Ktomk\Pipelines\File\ParseException');
41
        $this->expectExceptionMessage('message string');
42
43
        throw new ParseException('message string');
44
    }
45
}
46