SerialStrategyTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 19
c 1
b 0
f 1
wmc 1
lcom 0
cbo 6
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testHandle() 0 13 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: roma_bb8
5
 * Date: 30.03.18
6
 * Time: 10:53
7
 */
8
9
namespace Symfony\Component\Debug\Extension\Tests\Strategies;
10
11
12
use RuntimeException;
13
use Symfony\Component\Debug\Extension\ErrorHandler;
14
use Symfony\Component\Debug\Extension\Tests\TestCase;
15
use Symfony\Component\Debug\Extension\Strategies\SerialStrategy;
16
use Symfony\Component\Debug\Extension\Tests\Handlers\ExceptionHandler;
17
use Symfony\Component\Debug\Extension\Exceptions\ErrorHandlerException;
18
use Symfony\Component\Debug\Extension\Tests\Handlers\RuntimeExceptionHandler;
19
use Symfony\Component\Debug\Extension\Tests\Handlers\InvalidArgumentExceptionHandler;
20
21
/**
22
 * Class SerialStrategyTest
23
 * @package Symfony\Component\Debug\Extension\Tests\Strategies
24
 */
25
class SerialStrategyTest extends TestCase {
26
27
    /**
28
     * @throws ErrorHandlerException
29
     */
30
    public function testHandle() {
31
32
        $errorHandler = new ErrorHandler(new SerialStrategy());
33
34
        $errorHandler->registerHandler(new ExceptionHandler());
35
        $errorHandler->registerHandler(new InvalidArgumentExceptionHandler());
36
        $errorHandler->registerHandler(new RuntimeExceptionHandler());
37
38
        $errorHandler->handle(new RuntimeException('Hello World!'));
39
40
        $this->assertHandleException(self::getRootFolder() . ExceptionHandler::FILE);
41
        $this->assertHandleException(self::getRootFolder() . InvalidArgumentExceptionHandler::FILE);
42
    }
43
}
44