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

ErrorCatcherTest::testCreation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 9
rs 10
c 0
b 0
f 0
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