|
|
@@ -16,7 +16,7 @@ declare(strict_types=1);
|
|
|
*/
|
|
|
namespace Cake\Test\TestCase\Command;
|
|
|
|
|
|
-use Cake\Command\Command;
|
|
|
+use Cake\Console\CommandInterface;
|
|
|
use Cake\Routing\Route\Route;
|
|
|
use Cake\Routing\Router;
|
|
|
use Cake\TestSuite\ConsoleIntegrationTestTrait;
|
|
|
@@ -53,7 +53,7 @@ class RoutesCommandTest extends TestCase
|
|
|
public function testRouteListHelp(): void
|
|
|
{
|
|
|
$this->exec('routes -h');
|
|
|
- $this->assertExitCode(Command::CODE_SUCCESS);
|
|
|
+ $this->assertExitCode(CommandInterface::CODE_SUCCESS);
|
|
|
$this->assertOutputContains('list of routes');
|
|
|
$this->assertErrorEmpty();
|
|
|
}
|
|
|
@@ -64,7 +64,7 @@ class RoutesCommandTest extends TestCase
|
|
|
public function testRouteList(): void
|
|
|
{
|
|
|
$this->exec('routes');
|
|
|
- $this->assertExitCode(Command::CODE_SUCCESS);
|
|
|
+ $this->assertExitCode(CommandInterface::CODE_SUCCESS);
|
|
|
$this->assertOutputContainsRow([
|
|
|
'<info>Route name</info>',
|
|
|
'<info>URI template</info>',
|
|
|
@@ -109,7 +109,7 @@ class RoutesCommandTest extends TestCase
|
|
|
public function testRouteListVerbose(): void
|
|
|
{
|
|
|
$this->exec('routes -v');
|
|
|
- $this->assertExitCode(Command::CODE_SUCCESS);
|
|
|
+ $this->assertExitCode(CommandInterface::CODE_SUCCESS);
|
|
|
$this->assertOutputContainsRow([
|
|
|
'<info>Route name</info>',
|
|
|
'<info>URI template</info>',
|
|
|
@@ -142,7 +142,7 @@ class RoutesCommandTest extends TestCase
|
|
|
);
|
|
|
|
|
|
$this->exec('routes -s');
|
|
|
- $this->assertExitCode(Command::CODE_SUCCESS);
|
|
|
+ $this->assertExitCode(CommandInterface::CODE_SUCCESS);
|
|
|
$this->assertOutputContains('_aRoute', $this->_out->messages()[3]);
|
|
|
}
|
|
|
|
|
|
@@ -152,7 +152,7 @@ class RoutesCommandTest extends TestCase
|
|
|
public function testCheckHelp(): void
|
|
|
{
|
|
|
$this->exec('routes check -h');
|
|
|
- $this->assertExitCode(Command::CODE_SUCCESS);
|
|
|
+ $this->assertExitCode(CommandInterface::CODE_SUCCESS);
|
|
|
$this->assertOutputContains('Check a URL');
|
|
|
$this->assertErrorEmpty();
|
|
|
}
|
|
|
@@ -163,7 +163,7 @@ class RoutesCommandTest extends TestCase
|
|
|
public function testCheckNoInput(): void
|
|
|
{
|
|
|
$this->exec('routes check');
|
|
|
- $this->assertExitCode(Command::CODE_ERROR);
|
|
|
+ $this->assertExitCode(CommandInterface::CODE_ERROR);
|
|
|
$this->assertErrorContains('`url` argument is required');
|
|
|
}
|
|
|
|
|
|
@@ -173,7 +173,7 @@ class RoutesCommandTest extends TestCase
|
|
|
public function testCheck(): void
|
|
|
{
|
|
|
$this->exec('routes check /app/articles/check');
|
|
|
- $this->assertExitCode(Command::CODE_SUCCESS);
|
|
|
+ $this->assertExitCode(CommandInterface::CODE_SUCCESS);
|
|
|
$this->assertOutputContainsRow([
|
|
|
'<info>Route name</info>',
|
|
|
'<info>URI template</info>',
|
|
|
@@ -192,7 +192,7 @@ class RoutesCommandTest extends TestCase
|
|
|
public function testCheckWithNamedRoute(): void
|
|
|
{
|
|
|
$this->exec('routes check /app/tests/index');
|
|
|
- $this->assertExitCode(Command::CODE_SUCCESS);
|
|
|
+ $this->assertExitCode(CommandInterface::CODE_SUCCESS);
|
|
|
$this->assertOutputContainsRow([
|
|
|
'<info>Route name</info>',
|
|
|
'<info>URI template</info>',
|
|
|
@@ -211,7 +211,7 @@ class RoutesCommandTest extends TestCase
|
|
|
public function testCheckWithRedirectRoute(): void
|
|
|
{
|
|
|
$this->exec('routes check /app/redirect');
|
|
|
- $this->assertExitCode(Command::CODE_SUCCESS);
|
|
|
+ $this->assertExitCode(CommandInterface::CODE_SUCCESS);
|
|
|
$this->assertOutputContainsRow([
|
|
|
'<info>URI template</info>',
|
|
|
'<info>Redirect</info>',
|
|
|
@@ -228,7 +228,7 @@ class RoutesCommandTest extends TestCase
|
|
|
public function testCheckNotFound(): void
|
|
|
{
|
|
|
$this->exec('routes check /nope');
|
|
|
- $this->assertExitCode(Command::CODE_ERROR);
|
|
|
+ $this->assertExitCode(CommandInterface::CODE_ERROR);
|
|
|
$this->assertErrorContains('did not match');
|
|
|
}
|
|
|
|
|
|
@@ -238,7 +238,7 @@ class RoutesCommandTest extends TestCase
|
|
|
public function testGenerareHelp(): void
|
|
|
{
|
|
|
$this->exec('routes generate -h');
|
|
|
- $this->assertExitCode(Command::CODE_SUCCESS);
|
|
|
+ $this->assertExitCode(CommandInterface::CODE_SUCCESS);
|
|
|
$this->assertOutputContains('Check a routing array');
|
|
|
$this->assertErrorEmpty();
|
|
|
}
|
|
|
@@ -249,7 +249,7 @@ class RoutesCommandTest extends TestCase
|
|
|
public function testGenerateNoPassArgs(): void
|
|
|
{
|
|
|
$this->exec('routes generate controller:Articles action:index');
|
|
|
- $this->assertExitCode(Command::CODE_SUCCESS);
|
|
|
+ $this->assertExitCode(CommandInterface::CODE_SUCCESS);
|
|
|
$this->assertOutputContains('> /app/articles');
|
|
|
$this->assertErrorEmpty();
|
|
|
}
|
|
|
@@ -260,7 +260,7 @@ class RoutesCommandTest extends TestCase
|
|
|
public function testGeneratePassedArguments(): void
|
|
|
{
|
|
|
$this->exec('routes generate controller:Articles action:view 2 3');
|
|
|
- $this->assertExitCode(Command::CODE_SUCCESS);
|
|
|
+ $this->assertExitCode(CommandInterface::CODE_SUCCESS);
|
|
|
$this->assertOutputContains('> /app/articles/view/2/3');
|
|
|
$this->assertErrorEmpty();
|
|
|
}
|
|
|
@@ -271,7 +271,7 @@ class RoutesCommandTest extends TestCase
|
|
|
public function testGenerateBoolParams(): void
|
|
|
{
|
|
|
$this->exec('routes generate controller:Articles action:index _ssl:true _host:example.com');
|
|
|
- $this->assertExitCode(Command::CODE_SUCCESS);
|
|
|
+ $this->assertExitCode(CommandInterface::CODE_SUCCESS);
|
|
|
$this->assertOutputContains('> https://example.com/app/articles');
|
|
|
}
|
|
|
|
|
|
@@ -281,7 +281,7 @@ class RoutesCommandTest extends TestCase
|
|
|
public function testGenerateMissing(): void
|
|
|
{
|
|
|
$this->exec('routes generate plugin:Derp controller:Derp');
|
|
|
- $this->assertExitCode(Command::CODE_ERROR);
|
|
|
+ $this->assertExitCode(CommandInterface::CODE_ERROR);
|
|
|
$this->assertErrorContains('do not match');
|
|
|
}
|
|
|
|
|
|
@@ -299,7 +299,7 @@ class RoutesCommandTest extends TestCase
|
|
|
);
|
|
|
|
|
|
$this->exec('routes');
|
|
|
- $this->assertExitCode(Command::CODE_SUCCESS);
|
|
|
+ $this->assertExitCode(CommandInterface::CODE_SUCCESS);
|
|
|
$this->assertOutputContainsRow([
|
|
|
'<info>Route name</info>',
|
|
|
'<info>URI template</info>',
|