Completed
Push — master ( 5635b0...3b50b8 )
by Christian
02:38
created

ExecuteCodeTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testThatExceptionIsPropagated() 0 23 1
1
<?php
2
3
namespace uuf6429\ElderBrother\Action;
4
5
use uuf6429\ElderBrother\Config;
6
use Symfony\Component\Console\Input;
7
use Symfony\Component\Console\Output;
8
9
class ExecuteCodeTest extends \PHPUnit_Framework_TestCase
10
{
11
    public function testThatExceptionIsPropagated()
12
    {
13
        $action = new ExecuteCode(
14
            'Do something',
15
            function ($config, $input, $output) {
16
                $this->assertInstanceOf(Config::class, $config);
17
                $this->assertInstanceOf(Input\InputInterface::class, $input);
18
                $this->assertInstanceOf(Output\OutputInterface::class, $output);
19
20
                throw new \RuntimeException('Testing');
21
            }
22
        );
23
24
        $action->setConfig(
25
            $this->getMockBuilder(Config::class)
26
                ->disableOriginalConstructor()
27
                ->getMock()
28
        );
29
30
        $this->setExpectedException(\RuntimeException::class, 'Testing');
31
32
        $action->execute(new Input\StringInput(''), new Output\NullOutput());
33
    }
34
}
35