|
|
@@ -22,6 +22,7 @@ use Cake\ORM\Table;
|
|
|
use Cake\TestSuite\Stub\ConsoleOutput;
|
|
|
use Cake\TestSuite\TestCase;
|
|
|
use InvalidArgumentException;
|
|
|
+use TestApp\Command\AbortCommand;
|
|
|
use TestApp\Command\AutoLoadModelCommand;
|
|
|
use TestApp\Command\DemoCommand;
|
|
|
|
|
|
@@ -343,6 +344,20 @@ class CommandTest extends TestCase
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * test executeCommand with an abort
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function testExecuteCommandAbort()
|
|
|
+ {
|
|
|
+ $output = new ConsoleOutput();
|
|
|
+ $command = new Command();
|
|
|
+ $result = $command->executeCommand(AbortCommand::class, [], $this->getMockIo($output));
|
|
|
+ $this->assertSame(127, $result);
|
|
|
+ $this->assertEquals(['<error>Command aborted</error>'], $output->messages());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* test executeCommand with an invalid instance
|
|
|
*
|
|
|
* @return void
|