Completed
Push — master ( 8110dc...01b890 )
by Robbie
01:10
created

AbstractCommandTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace SilverLeague\Console\Tests\Command;
4
5
use SilverLeague\Console\Framework\Scaffold;
6
7
/**
8
 * An abstract base for testing SilverStripeCommand classes
9
 *
10
 * @package silverstripe-console
11
 * @author  Robbie Averill <[email protected]>
12
 */
13
abstract class AbstractCommandTest extends \PHPUnit_Framework_TestCase
14
{
15
    /**
16
     * The test subject
17
     *
18
     * @var LookupCommand
19
     */
20
    protected $command;
21
22
    /**
23
     * Add the command
24
     */
25
    public function setUp()
26
    {
27
        $this->command = (new Scaffold)->getApplication()->find($this->getTestCommand());
0 ignored issues
show
Documentation Bug introduced by
It seems like (new \SilverLeague\Conso...this->getTestCommand()) of type object<Symfony\Component\Console\Command\Command> is incompatible with the declared type object<SilverLeague\Cons...\Command\LookupCommand> of property $command.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
28
    }
29
30
    /**
31
     * Provide the command name to test, e.g. "object:lookup"
32
     *
33
     * @return string
34
     */
35
    abstract public function getTestCommand();
36
}
37