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

AbstractCommandTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 1
cbo 2
dl 0
loc 24
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
getTestCommand() 0 1 ?
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