Passed
Push — main ( cebfe5...3df9c7 )
by Sebastian
04:33
created

SuccessTest::testExecute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 11
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 16
rs 9.9
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 SuccessTest extends TestCase
23
{
24
    use ConfigMockery;
25
    use IOMockery;
26
    use CHMockery;
27
28
    /**
29
     * Tests Debug::execute
30
     *
31
     * @throws \Exception
32
     */
33
    public function testExecute(): void
34
    {
35
        $config       = $this->createConfigMock(true);
36
        $io           = $this->createIOMock();
37
        $repository   = $this->createRepositoryMock();
38
        $action       = new Action('\\' . Debug::class);
39
        $infoOperator = $this->createGitInfoOperator('1.0.0');
40
41
        $io->expects($this->once())->method('getArguments')->willReturn(['foo' => 'bar']);
42
        $io->expects($this->atLeast(3))->method('write');
43
        $repository->expects($this->exactly(1))->method('getInfoOperator')->willReturn($infoOperator);
44
45
        $debug = new Success();
46
        $debug->execute($config, $io, $repository, $action);
47
48
        $this->assertTrue(true);
49
    }
50
}
51