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

ExecuteCodeTest::testThatExceptionIsPropagated()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 23
rs 9.0856
cc 1
eloc 14
nc 1
nop 0
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