| @@ 12-27 (lines=16) @@ | ||
| 9 | class CommandIntegration extends TestCase { |
|
| 10 | ||
| 11 | /** @test */ |
|
| 12 | public function success() |
|
| 13 | { |
|
| 14 | $command = new Command(); |
|
| 15 | ||
| 16 | $result = $command->execute(new Clear()); |
|
| 17 | ||
| 18 | $expectedArray = [ |
|
| 19 | [ |
|
| 20 | 'type' => 'info', |
|
| 21 | 'content' => 'Output text...', |
|
| 22 | ] |
|
| 23 | ]; |
|
| 24 | ||
| 25 | $this->assertNotNull($result['timestamp']); |
|
| 26 | $this->assertEquals($result['lines'], $expectedArray); |
|
| 27 | } |
|
| 28 | ||
| 29 | /** @test */ |
|
| 30 | public function unauthorized() |
|
| @@ 13-30 (lines=18) @@ | ||
| 10 | class TerminalIntegration extends TestCase { |
|
| 11 | ||
| 12 | /** @test */ |
|
| 13 | public function success() |
|
| 14 | { |
|
| 15 | $terminal = new Terminal([ |
|
| 16 | Clear::class, |
|
| 17 | ]); |
|
| 18 | ||
| 19 | $result = $terminal->execute('/clear'); |
|
| 20 | ||
| 21 | $expectedArray = [ |
|
| 22 | [ |
|
| 23 | 'type' => 'info', |
|
| 24 | 'content' => 'Output text...', |
|
| 25 | ] |
|
| 26 | ]; |
|
| 27 | ||
| 28 | $this->assertNotNull($result['timestamp']); |
|
| 29 | $this->assertEquals($result['lines'], $expectedArray); |
|
| 30 | } |
|
| 31 | ||
| 32 | ||
| 33 | /** @test */ |
|