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

DebugRoutesCommandTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 16
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCommand() 0 14 1
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