Passed
Pull Request — master (#216)
by Dmitriy
03:24 queued 37s
created

DebugRoutesCommandTest::testCommand()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 9
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 14
rs 9.9666
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Debug\Tests\Unit\Command;
6
7
use PHPUnit\Framework\TestCase;
8
use Symfony\Component\Console\Tester\CommandTester;
9
use Yiisoft\Router\RouteCollectionInterface;
10
use Yiisoft\Yii\Debug\Command\DebugRoutesCommand;
11
use Yiisoft\Yii\Debug\Debugger;
12
use Yiisoft\Yii\Debug\DebuggerIdGenerator;
13
use Yiisoft\Yii\Debug\Storage\StorageInterface;
14
15
final class DebugRoutesCommandTest extends TestCase
16
{
17
    public function testCommand()
18
    {
19
        $routeCollection = $this->createMock(RouteCollectionInterface::class);
20
        $routeCollection->method('getRoutes')->willReturn([]);
21
        $idGenerator = new DebuggerIdGenerator();
22
        $storage = $this->createMock(StorageInterface::class);
23
        $storage->expects($this->never())->method('clear');
24
        $debugger = new Debugger($idGenerator, $storage, []);
25
26
        $command = new DebugRoutesCommand($routeCollection, $debugger);
27
28
        $commandTester = new CommandTester($command);
29
30
        $commandTester->execute([]);
31
    }
32
}
33