Completed
Push — master ( 8110dc...01b890 )
by Robbie
01:51 queued 43s
created

LookupCommandTest::testConfigure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace SilverLeague\Console\Tests\Command\Object;
4
5
use SilverLeague\Console\Command\Object\LookupCommand;
6
use SilverLeague\Console\Tests\Command\AbstractCommandTest;
7
use Symfony\Component\Console\Tester\CommandTester;
8
9
/**
10
 * @coversDefaultClass \SilverLeague\Console\Command\Object\LookupCommand
11
 * @package silverstripe-console
12
 * @author  Robbie Averill <[email protected]>
13
 */
14 View Code Duplication
class LookupCommandTest extends AbstractCommandTest
1 ignored issue
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
{
16
    /**
17
     * {@inheritDoc}
18
     */
19
    public function getTestCommand()
20
    {
21
        return 'object:lookup';
22
    }
23
24
    /**
25
     * Ensure that the Injector's class resolution is returned for a given Object
26
     *
27
     * @covers ::execute
28
     */
29
    public function testExecute()
30
    {
31
        $tester = new CommandTester($this->command);
32
        $tester->execute(
33
            [
34
                'command' => $this->command->getName(),
35
                'object'  => 'Logger'
36
            ]
37
        );
38
39
        $output = $tester->getDisplay();
40
        $this->assertContains("Monolog\Logger", $output);
41
    }
42
43
    /**
44
     * Ensure that the InputArgument for the object is added
45
     *
46
     * @covers ::configure
47
     */
48
    public function testConfigure()
49
    {
50
        $this->assertTrue($this->command->getDefinition()->hasArgument('object'));
51
    }
52
}
53