ConsoleApplicationFacadeTest::testRun()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 11
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 *  This file is part of the Micro framework package.
7
 *
8
 *  (c) Stanislau Komar <[email protected]>
9
 *
10
 *  For the full copyright and license information, please view the LICENSE
11
 *  file that was distributed with this source code.
12
 */
13
14
namespace Micro\Plugin\Console\Test\Unit\Facade;
15
16
use Micro\Plugin\Console\Business\Factory\ConsoleApplicationFactoryInterface;
17
use Micro\Plugin\Console\Facade\ConsoleApplicationFacade;
18
use PHPUnit\Framework\TestCase;
19
use Symfony\Component\Console\Application;
20
21
class ConsoleApplicationFacadeTest extends TestCase
22
{
23
    public function testRun()
24
    {
25
        $app = $this->createMock(Application::class);
26
        $app->expects($this->once())->method('run')->willReturn(1);
27
        $factory = $this->createMock(ConsoleApplicationFactoryInterface::class);
28
        $factory->expects($this->once())->method('create')->willReturn($app);
29
        $facade = new ConsoleApplicationFacade(
30
            $factory,
31
        );
32
33
        $this->assertEquals(1, $facade->run());
34
    }
35
}
36