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 | * The expected result if $command->getArgumentText(['a', '1']) was called. |
||
48 | * |
||
49 | * @return string |
||
50 | */ |
||
51 | abstract protected function getExpectedArgumentText(); |
||
52 | |||
53 | /** |
||
54 | * @return void |
||
55 | */ |
||
56 | public function testParseResponseSuccess() |
||
72 | |||
73 | /** |
||
74 | * @return void |
||
75 | */ |
||
76 | public function testParseResponseError() |
||
90 | |||
91 | public function testGetArgumentText() |
||
96 | |||
97 | /** |
||
98 | * @param string $prompt |
||
99 | * @param string $rawResponse |
||
100 | * @param bool $isError |
||
101 | * |
||
102 | * @return TelnetResponseInterface |
||
103 | */ |
||
104 | protected function buildTelnetResponse($prompt, $rawResponse, $isError) |
||
124 | } |
||
125 |