1 | <?php |
||
23 | abstract class AbstractCommandTestCase extends \PHPUnit_Framework_TestCase |
||
24 | { |
||
25 | /** |
||
26 | * Returns the Command to be tested |
||
27 | * |
||
28 | * @return \Graze\Dynamark3Client\Command\CommandInterface |
||
29 | */ |
||
30 | abstract protected function getCommand(); |
||
31 | |||
32 | /** |
||
33 | * An example response from the Dynamark3 server, including line endings |
||
34 | * |
||
35 | * @return string |
||
36 | */ |
||
37 | abstract protected function getRawTelnetResponse(); |
||
38 | |||
39 | /** |
||
40 | * The expected response text once Command has parsed the TelnetResponse |
||
41 | * |
||
42 | * @return string |
||
43 | */ |
||
44 | abstract protected function getExpectedResponseText(); |
||
45 | |||
46 | /** |
||
47 | * @return void |
||
48 | */ |
||
49 | public function testCommandSuccess() |
||
65 | |||
66 | /** |
||
67 | * @return void |
||
68 | */ |
||
69 | public function testCommandError() |
||
83 | |||
84 | /** |
||
85 | * @param string $prompt |
||
86 | * @param string $rawResponse |
||
87 | * @param bool $isError |
||
88 | * |
||
89 | * @return TelnetResponseInterface |
||
90 | */ |
||
91 | protected function buildTelnetResponse($prompt, $rawResponse, $isError) |
||
111 | } |
||
112 |