Passed
Push — test ( d838cf...cef4a5 )
by Tom
03:29
created

ErrorCatcherTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreation() 0 9 1
A testEnd() 0 4 1
A testEndWithError() 0 5 1
1
<?php
2
3
/* this file is part of pipelines */
4
5
namespace Ktomk\Pipelines;
6
7
/**
8
 * @covers \Ktomk\Pipelines\ErrorCatcher
9
 */
10
class ErrorCatcherTest extends TestCase
11
{
12
    public function testCreation()
13
    {
14
        $catcher = new ErrorCatcher();
15
16
        self::assertInstanceOf('Ktomk\Pipelines\ErrorCatcher', $catcher);
17
18
        $catcher = ErrorCatcher::create();
19
20
        self::assertInstanceOf('Ktomk\Pipelines\ErrorCatcher', $catcher);
21
    }
22
23
    public function testEnd()
24
    {
25
        $catcher = new ErrorCatcher();
26
        self::assertFalse($catcher->end());
27
    }
28
29
    public function testEndWithError()
30
    {
31
        $catcher = new ErrorCatcher();
32
        trigger_error('test');
33
        self::assertTrue($catcher->end());
34
    }
35
}
36