PostCheckoutTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testExecute() 0 18 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\Console\Command\Hook;
13
14
use CaptainHook\App\Console\Runtime\Resolver;
15
use CaptainHook\App\Git\DummyRepo;
16
use CaptainHook\App\Hooks;
17
use Symfony\Component\Console\Input\ArrayInput;
18
use Symfony\Component\Console\Output\NullOutput;
19
use PHPUnit\Framework\TestCase;
20
21
class PostCheckoutTest extends TestCase
22
{
23
    public function testExecute(): void
24
    {
25
        $repo   = new DummyRepo();
26
        $output = new NullOutput();
27
        $input  = new ArrayInput(
28
            [
29
                '--configuration'        => CH_PATH_FILES . '/config/valid.json',
30
                '--git-directory'        => $repo->getGitDir(),
31
                Hooks::ARG_PREVIOUS_HEAD => '3e76d8',
32
                Hooks::ARG_NEW_HEAD      => '7d9ac4',
33
                Hooks::ARG_MODE          => 'branch'
34
            ]
35
        );
36
37
        $cmd = new PostCheckout(new Resolver());
38
        $cmd->run($input, $output);
39
40
        $this->assertTrue(true);
41
    }
42
}
43