Browse Source

replace shell with command where possible

saeid 6 years ago
parent
commit
633bcac5fc
1 changed files with 24 additions and 24 deletions
  1. 24 24
      tests/TestCase/Command/CompletionCommandTest.php

+ 24 - 24
tests/TestCase/Command/CompletionCommandTest.php

@@ -16,7 +16,7 @@ declare(strict_types=1);
  */
 namespace Cake\Test\TestCase\Command;
 
-use Cake\Console\Shell;
+use Cake\Console\Command;
 use Cake\Core\Configure;
 use Cake\Routing\Router;
 use Cake\TestSuite\ConsoleIntegrationTestCase;
@@ -53,14 +53,14 @@ class CompletionCommandTest extends ConsoleIntegrationTestCase
     }
 
     /**
-     * test that the startup method suppresses the shell header
+     * test that the startup method suppresses the command header
      *
      * @return void
      */
     public function testStartup()
     {
         $this->exec('completion');
-        $this->assertExitCode(Shell::CODE_ERROR);
+        $this->assertExitCode(Command::CODE_ERROR);
 
         $this->assertOutputNotContains('Welcome to CakePHP');
     }
@@ -73,7 +73,7 @@ class CompletionCommandTest extends ConsoleIntegrationTestCase
     public function testCommands()
     {
         $this->exec('completion commands');
-        $this->assertExitCode(Shell::CODE_SUCCESS);
+        $this->assertExitCode(Command::CODE_SUCCESS);
 
         $expected = [
             'test_plugin.example',
@@ -113,7 +113,7 @@ class CompletionCommandTest extends ConsoleIntegrationTestCase
     public function testOptionsNoArguments()
     {
         $this->exec('completion options');
-        $this->assertExitCode(Shell::CODE_SUCCESS);
+        $this->assertExitCode(Command::CODE_SUCCESS);
         $this->assertOutputEmpty();
     }
 
@@ -125,7 +125,7 @@ class CompletionCommandTest extends ConsoleIntegrationTestCase
     public function testOptionsNonExistingCommand()
     {
         $this->exec('completion options foo');
-        $this->assertExitCode(Shell::CODE_SUCCESS);
+        $this->assertExitCode(Command::CODE_SUCCESS);
         $this->assertOutputEmpty();
     }
 
@@ -134,10 +134,10 @@ class CompletionCommandTest extends ConsoleIntegrationTestCase
      *
      * @return void
      */
-    public function testOptionsShell()
+    public function testOptionsCommand()
     {
         $this->exec('completion options schema_cache');
-        $this->assertExitCode(Shell::CODE_SUCCESS);
+        $this->assertExitCode(Command::CODE_SUCCESS);
 
         $expected = [
             '--connection -c',
@@ -162,7 +162,7 @@ class CompletionCommandTest extends ConsoleIntegrationTestCase
             'This test does not work correctly with shells.'
         );
         $this->exec('completion options sample sample');
-        $this->assertExitCode(Shell::CODE_SUCCESS);
+        $this->assertExitCode(Command::CODE_SUCCESS);
 
         $expected = [
             '--help -h',
@@ -180,10 +180,10 @@ class CompletionCommandTest extends ConsoleIntegrationTestCase
      *
      * @return void
      */
-    public function testOptionsShellCommand()
+    public function testOptionsSubCommand()
     {
         $this->exec('completion options cache list');
-        $this->assertExitCode(Shell::CODE_SUCCESS);
+        $this->assertExitCode(Command::CODE_SUCCESS);
 
         $expected = [
             '--help -h',
@@ -203,7 +203,7 @@ class CompletionCommandTest extends ConsoleIntegrationTestCase
     public function testOptionsNestedCommand()
     {
         $this->exec('completion options i18n extract');
-        $this->assertExitCode(Shell::CODE_SUCCESS);
+        $this->assertExitCode(Command::CODE_SUCCESS);
 
         $expected = [
             '--plugin',
@@ -221,7 +221,7 @@ class CompletionCommandTest extends ConsoleIntegrationTestCase
     public function testSubCommandsCorePlugin()
     {
         $this->exec('completion subcommands schema_cache');
-        $this->assertExitCode(Shell::CODE_SUCCESS);
+        $this->assertExitCode(Command::CODE_SUCCESS);
 
         $expected = "build clear";
         $this->assertOutputContains($expected);
@@ -235,7 +235,7 @@ class CompletionCommandTest extends ConsoleIntegrationTestCase
     public function testSubCommandsAppPlugin()
     {
         $this->exec('completion subcommands sample');
-        $this->assertExitCode(Shell::CODE_SUCCESS);
+        $this->assertExitCode(Command::CODE_SUCCESS);
         $expected = [
             'derp',
             'returnValue',
@@ -263,7 +263,7 @@ class CompletionCommandTest extends ConsoleIntegrationTestCase
     public function testSubCommandsCoreMultiwordCommand()
     {
         $this->exec('completion subcommands cache');
-        $this->assertExitCode(Shell::CODE_SUCCESS);
+        $this->assertExitCode(Command::CODE_SUCCESS);
 
         $expected = [
             'list', 'clear', 'clear_all',
@@ -282,7 +282,7 @@ class CompletionCommandTest extends ConsoleIntegrationTestCase
     public function testSubCommandsPlugin()
     {
         $this->exec('completion subcommands welcome');
-        $this->assertExitCode(Shell::CODE_SUCCESS);
+        $this->assertExitCode(Command::CODE_SUCCESS);
 
         $expected = "say_hello";
         $this->assertOutputContains($expected);
@@ -296,7 +296,7 @@ class CompletionCommandTest extends ConsoleIntegrationTestCase
     public function testSubCommandsPluginDotNotationBackwardCompatibility()
     {
         $this->exec('completion subcommands test_plugin_two.welcome');
-        $this->assertExitCode(Shell::CODE_SUCCESS);
+        $this->assertExitCode(Command::CODE_SUCCESS);
 
         $expected = "say_hello";
         $this->assertOutputContains($expected);
@@ -310,7 +310,7 @@ class CompletionCommandTest extends ConsoleIntegrationTestCase
     public function testSubCommandsPluginDotNotation()
     {
         $this->exec('completion subcommands test_plugin_two.example');
-        $this->assertExitCode(Shell::CODE_SUCCESS);
+        $this->assertExitCode(Command::CODE_SUCCESS);
 
         $expected = "say_hello";
         $this->assertOutputContains($expected);
@@ -325,7 +325,7 @@ class CompletionCommandTest extends ConsoleIntegrationTestCase
     public function testSubCommandsAppDuplicatePluginNoDot()
     {
         $this->exec('completion subcommands sample');
-        $this->assertExitCode(Shell::CODE_SUCCESS);
+        $this->assertExitCode(Command::CODE_SUCCESS);
 
         $expected = [
             'derp',
@@ -346,7 +346,7 @@ class CompletionCommandTest extends ConsoleIntegrationTestCase
     public function testSubCommandsPluginDuplicateApp()
     {
         $this->exec('completion subcommands test_plugin.sample');
-        $this->assertExitCode(Shell::CODE_SUCCESS);
+        $this->assertExitCode(Command::CODE_SUCCESS);
 
         $expected = "example";
         $this->assertOutputContains($expected);
@@ -360,7 +360,7 @@ class CompletionCommandTest extends ConsoleIntegrationTestCase
     public function testSubCommandsNoArguments()
     {
         $this->exec('completion subcommands');
-        $this->assertExitCode(Shell::CODE_SUCCESS);
+        $this->assertExitCode(Command::CODE_SUCCESS);
 
         $this->assertOutputEmpty();
     }
@@ -373,7 +373,7 @@ class CompletionCommandTest extends ConsoleIntegrationTestCase
     public function testSubCommandsNonExistingCommand()
     {
         $this->exec('completion subcommands foo');
-        $this->assertExitCode(Shell::CODE_SUCCESS);
+        $this->assertExitCode(Command::CODE_SUCCESS);
 
         $this->assertOutputEmpty();
     }
@@ -386,7 +386,7 @@ class CompletionCommandTest extends ConsoleIntegrationTestCase
     public function testSubCommands()
     {
         $this->exec('completion subcommands schema_cache');
-        $this->assertExitCode(Shell::CODE_SUCCESS);
+        $this->assertExitCode(Command::CODE_SUCCESS);
 
         $expected = "build clear";
         $this->assertOutputContains($expected);
@@ -411,7 +411,7 @@ class CompletionCommandTest extends ConsoleIntegrationTestCase
     public function testHelp()
     {
         $this->exec('completion --help');
-        $this->assertExitCode(Shell::CODE_SUCCESS);
+        $this->assertExitCode(Command::CODE_SUCCESS);
 
         $this->assertOutputContains('Output a list of available commands');
         $this->assertOutputContains('Output a list of available sub-commands');