1 | <?php |
||
15 | abstract class AbstractCommandTest extends \PHPUnit_Framework_TestCase |
||
16 | { |
||
17 | /** |
||
18 | * The test subject |
||
19 | * |
||
20 | * @var SilverStripeCommand |
||
21 | */ |
||
22 | protected $command; |
||
23 | |||
24 | /** |
||
25 | * Add the command |
||
26 | */ |
||
27 | protected function setUp() |
||
28 | { |
||
29 | $this->command = (new Scaffold)->getApplication()->find($this->getTestCommand()); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Provide the command name to test, e.g. "object:lookup" |
||
34 | * |
||
35 | * @return string |
||
36 | */ |
||
37 | abstract protected function getTestCommand(); |
||
38 | |||
39 | /** |
||
40 | * Create a CommandTester and execute the command with given arguments |
||
41 | * |
||
42 | * @param array $params |
||
43 | * @return CommandTester |
||
44 | */ |
||
45 | protected function executeTest(array $params = []) |
||
51 | } |
||
52 |