ChildrenCommandTest::testExecute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
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\ChildrenCommand
9
 * @package silverstripe-console
10
 * @author  Robbie Averill <[email protected]>
11
 */
12
class ChildrenCommandTest extends AbstractCommandTest
13
{
14
    /**
15
     * {@inheritDoc}
16
     */
17
    protected function getTestCommand()
18
    {
19
        return 'object:children';
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 testExecute()
28
    {
29
        $tester = $this->executeTest(['object' => "SilverStripe\Dev\BuildTask"]);
30
        $output = $tester->getDisplay();
31
        $this->assertContains("SilverStripe\Dev\Tasks\CleanupTestDatabasesTask", $output);
32
        $this->assertContains('silverstripe/framework', $output);
33
    }
34
35
    /**
36
     * Ensure that the InputArgument for the object is added
37
     *
38
     * @covers ::configure
39
     */
40
    public function testConfigure()
41
    {
42
        $this->assertTrue($this->command->getDefinition()->hasArgument('object'));
43
    }
44
}
45