FailureTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testExecute() 0 16 1
1
<?php
2
3
/**
4
 * This file is part of CaptainHook
5
 *
6
 * (c) Sebastian Feldmann <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace CaptainHook\App\Hook\Debug;
13
14
use CaptainHook\App\Config\Action;
15
use CaptainHook\App\Config\Mockery as ConfigMockery;
16
use CaptainHook\App\Console\IO\Mockery as IOMockery;
17
use CaptainHook\App\Hook\Debug;
18
use CaptainHook\App\Mockery as CHMockery;
19
use Exception;
20
use PHPUnit\Framework\TestCase;
21
22
class FailureTest extends TestCase
23
{
24
    use ConfigMockery;
25
    use IOMockery;
26
    use CHMockery;
27
28
    public function testExecute(): void
29
    {
30
        $this->expectException(Exception::class);
31
32
        $config       = $this->createConfigMock(true);
33
        $io           = $this->createIOMock();
34
        $repository   = $this->createRepositoryMock();
35
        $action       = new Action('\\' . Debug::class);
36
        $infoOperator = $this->createGitInfoOperator('1.0.0');
37
38
        $io->expects($this->once())->method('getArguments')->willReturn(['foo' => 'bar']);
39
        $io->expects($this->atLeast(3))->method('write');
40
        $repository->expects($this->exactly(1))->method('getInfoOperator')->willReturn($infoOperator);
41
42
        $debug = new Failure();
43
        $debug->execute($config, $io, $repository, $action);
44
    }
45
}
46