LookupCommandTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
cbo 4
dl 0
loc 22
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testExecute() 0 8 1
A testExecuteWithoutPackage() 0 6 1
1
<?php
2
3
namespace Bowerphp\Test\Command;
4
5
use Bowerphp\Console\Application;
6
use PHPUnit\Framework\TestCase;
7
use Symfony\Component\Console\Tester\CommandTester;
8
9
/**
10
 * @group functional
11
 */
12
class LookupCommandTest extends TestCase
13
{
14
    public function testExecute()
15
    {
16
        $application = new Application();
17
        $commandTester = new CommandTester($command = $application->get('lookup'));
18
        $commandTester->execute(['command' => $command->getName(), 'package' => 'jquery'], ['decorated' => false]);
19
20
        $this->assertRegExp('/jquery-dist.git/', $commandTester->getDisplay());
21
    }
22
23
    /**
24
     * @expectedException \RuntimeException
25
     * @expectedExceptionMessage Not enough arguments
26
     */
27
    public function testExecuteWithoutPackage()
28
    {
29
        $application = new Application();
30
        $commandTester = new CommandTester($command = $application->get('lookup'));
31
        $commandTester->execute([], ['decorated' => false]);
32
    }
33
}
34