Completed
Pull Request — master (#25)
by Robbie
03:50 queued 42s
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 \SilverLeague\Console\Command\SilverStripeCommand
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());
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