Completed
Push — master ( 597ac5...b01469 )
by Robbie
9s
created

LookupCommandTest::testExecute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 6
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 6
loc 6
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace SilverLeague\Console\Tests\Command\Object;
4
5
use SilverLeague\Console\Tests\Command\AbstractCommandTest;
6
7
/**
8
 * @coversDefaultClass \SilverLeague\Console\Command\Object\LookupCommand
9
 * @package silverstripe-console
10
 * @author  Robbie Averill <[email protected]>
11
 */
12
class LookupCommandTest extends AbstractCommandTest
13
{
14
    /**
15
     * {@inheritDoc}
16
     */
17
    protected function getTestCommand()
18
    {
19
        return 'object:lookup';
20
    }
21
22
    /**
23
     * Ensure that the Injector's class resolution is returned for a given Object
24
     *
25
     * @covers ::execute
26
     */
27
    public function testExecuteWithRegularDependency()
28
    {
29
        $tester = $this->executeTest(['object' => 'Logger']);
30
        $output = $tester->getDisplay();
31
        $this->assertContains("Monolog\Logger", $output);
32
    }
33
34 View Code Duplication
    public function testExecuteWithSilverStripeClass()
0 ignored issues
show
Duplication introduced by
This method 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...
35
    {
36
        $tester = $this->executeTest(['object' => "SilverStripe\ORM\DataObject"]);
37
        $output = $tester->getDisplay();
38
        $this->assertContains("SilverStripe\ORM\DataObject", $output);
39
        $this->assertContains('silverstripe/framework', $output);
40
    }
41
42
    /**
43
     * Ensure that the InputArgument for the object is added
44
     *
45
     * @covers ::configure
46
     */
47
    public function testConfigure()
48
    {
49
        $this->assertTrue($this->command->getDefinition()->hasArgument('object'));
50
    }
51
}
52