Skip to content

Names::MIGRATE constant have been renamed to Names::ACTIONS #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Console/Migrate.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class Migrate extends Command
{
protected $signature = Names::MIGRATE;
protected $signature = Names::ACTIONS;

protected $description = 'Run the actions';

Expand Down
2 changes: 1 addition & 1 deletion src/Constants/Names.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Names

public const MAKE = 'make:action';

public const MIGRATE = 'actions';
public const ACTIONS = 'actions';

public const REFRESH = 'actions:refresh';

Expand Down
2 changes: 1 addition & 1 deletion src/Processors/Fresh.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected function drop(): void

protected function migrate(): void
{
$this->runCommand(Names::MIGRATE, [
$this->runCommand(Names::ACTIONS, [
'--' . Options::CONNECTION => $this->options->connection,
'--' . Options::PATH => $this->options->path,
'--' . Options::REALPATH => true,
Expand Down
2 changes: 1 addition & 1 deletion src/Processors/Refresh.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected function runReset(?string $connection, ?string $path, bool $realPath =

protected function runMigrate(?string $connection, ?string $path, bool $realPath = true): void
{
$this->runCommand(Names::MIGRATE, [
$this->runCommand(Names::ACTIONS, [
'--' . Options::CONNECTION => $connection,
'--' . Options::PATH => $path,
'--' . Options::REALPATH => $realPath,
Expand Down
84 changes: 42 additions & 42 deletions tests/Commands/ActionsTest.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/Commands/FreshTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testFreshCommand(): void
$this->assertDatabaseCount($this->table, 0);

$this->artisan(Names::MAKE, ['name' => 'Fresh'])->assertExitCode(0);
$this->artisan(Names::MIGRATE)->assertExitCode(0);
$this->artisan(Names::ACTIONS)->assertExitCode(0);

$this->assertDatabaseHasTable($this->table);
$this->assertDatabaseCount($this->table, 1);
Expand Down
2 changes: 1 addition & 1 deletion tests/Commands/RefreshTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function testRefreshCommand()
$this->assertDatabaseCount($this->table, 0);

$this->artisan(Names::MAKE, ['name' => 'Refresh'])->assertExitCode(0);
$this->artisan(Names::MIGRATE)->assertExitCode(0);
$this->artisan(Names::ACTIONS)->assertExitCode(0);

$this->assertDatabaseHasTable($this->table);
$this->assertDatabaseCount($this->table, 1);
Expand Down
2 changes: 1 addition & 1 deletion tests/Commands/ResetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function testResetCommand()
$this->assertDatabaseCount($this->table, 0);

$this->artisan(Names::MAKE, ['name' => 'Reset'])->assertExitCode(0);
$this->artisan(Names::MIGRATE)->assertExitCode(0);
$this->artisan(Names::ACTIONS)->assertExitCode(0);

$this->assertDatabaseHasTable($this->table);
$this->assertDatabaseCount($this->table, 1);
Expand Down
28 changes: 14 additions & 14 deletions tests/Commands/RollbackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function testRollbackCommand()
$this->artisan(Names::MAKE, ['name' => 'RollbackOne'])->assertExitCode(0);
$this->artisan(Names::MAKE, ['name' => 'RollbackTwo'])->assertExitCode(0);

$this->artisan(Names::MIGRATE)->assertExitCode(0);
$this->artisan(Names::ACTIONS)->assertExitCode(0);

$this->assertDatabaseHasTable($this->table);
$this->assertDatabaseCount($this->table, 2);
Expand All @@ -36,13 +36,13 @@ public function testRollbackCommand()
$this->assertDatabaseHasTable($this->table);
$this->assertDatabaseCount($this->table, 0);

$this->artisan(Names::MIGRATE)->assertExitCode(0);
$this->artisan(Names::ACTIONS)->assertExitCode(0);

$this->assertDatabaseHasTable($this->table);
$this->assertDatabaseCount($this->table, 2);

$this->artisan(Names::MAKE, ['name' => 'RollbackTree'])->assertExitCode(0);
$this->artisan(Names::MIGRATE)->assertExitCode(0);
$this->artisan(Names::ACTIONS)->assertExitCode(0);

$this->assertDatabaseHasTable($this->table);
$this->assertDatabaseCount($this->table, 3);
Expand All @@ -66,15 +66,15 @@ public function testEnvironment()
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_on_production');
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_on_testing');
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_on_many_environments');
$this->artisan(Names::MIGRATE)->assertExitCode(0);
$this->artisan(Names::ACTIONS)->assertExitCode(0);

$this->assertDatabaseCount($table, 5);
$this->assertDatabaseCount($this->table, 12);
$this->assertDatabaseMigrationHas($this->table, 'run_on_all');
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_on_production');
$this->assertDatabaseMigrationHas($this->table, 'run_on_testing');
$this->assertDatabaseMigrationHas($this->table, 'run_on_many_environments');
$this->artisan(Names::MIGRATE)->assertExitCode(0);
$this->artisan(Names::ACTIONS)->assertExitCode(0);

$this->artisan(Names::ROLLBACK)->assertExitCode(0);
$this->assertDatabaseCount($table, 10);
Expand All @@ -96,7 +96,7 @@ public function testDownSuccess()
$this->assertDatabaseCount($table, 0);
$this->assertDatabaseCount($this->table, 0);
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_success');
$this->artisan(Names::MIGRATE)->assertExitCode(0);
$this->artisan(Names::ACTIONS)->assertExitCode(0);

$this->assertDatabaseCount($table, 2);
$this->assertDatabaseCount($this->table, 12);
Expand All @@ -119,7 +119,7 @@ public function testDownSuccessOnFailed()
$this->assertDatabaseCount($table, 0);
$this->assertDatabaseCount($this->table, 0);
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_success_on_failed');
$this->artisan(Names::MIGRATE)->assertExitCode(0);
$this->artisan(Names::ACTIONS)->assertExitCode(0);

$this->assertDatabaseCount($table, 2);
$this->assertDatabaseCount($this->table, 12);
Expand Down Expand Up @@ -160,7 +160,7 @@ public function testDownFailed()
$this->assertDatabaseCount($table, 0);
$this->assertDatabaseCount($this->table, 0);
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_failed');
$this->artisan(Names::MIGRATE)->assertExitCode(0);
$this->artisan(Names::ACTIONS)->assertExitCode(0);

$this->assertDatabaseCount($table, 0);
$this->assertDatabaseCount($this->table, 12);
Expand All @@ -183,7 +183,7 @@ public function testUpFailedOnException()
$this->assertDatabaseCount($table, 0);
$this->assertDatabaseCount($this->table, 0);
$this->assertDatabaseMigrationDoesntLike($this->table, 'run_failed_failure');
$this->artisan(Names::MIGRATE)->assertExitCode(0);
$this->artisan(Names::ACTIONS)->assertExitCode(0);

$this->assertDatabaseCount($table, 0);
$this->assertDatabaseCount($this->table, 12);
Expand Down Expand Up @@ -221,13 +221,13 @@ public function testDisabledBefore()
$this->assertDatabaseCount($this->table, 0);
$this->assertDatabaseMigrationDoesntLike($this->table, 'test_before_enabled');
$this->assertDatabaseMigrationDoesntLike($this->table, 'test_before_disabled');
$this->artisan(Names::MIGRATE)->assertExitCode(0);
$this->artisan(Names::ACTIONS)->assertExitCode(0);

$this->assertDatabaseCount($table, 2);
$this->assertDatabaseCount($this->table, 12);
$this->assertDatabaseMigrationHas($this->table, 'test_before_enabled');
$this->assertDatabaseMigrationHas($this->table, 'test_before_disabled');
$this->artisan(Names::MIGRATE)->assertExitCode(0);
$this->artisan(Names::ACTIONS)->assertExitCode(0);

$this->artisan(Names::ROLLBACK)->assertExitCode(0);

Expand All @@ -249,13 +249,13 @@ public function testEnabledBefore()
$this->assertDatabaseCount($this->table, 0);
$this->assertDatabaseMigrationDoesntLike($this->table, 'test_before_enabled');
$this->assertDatabaseMigrationDoesntLike($this->table, 'test_before_disabled');
$this->artisan(Names::MIGRATE, ['--before' => true])->assertExitCode(0);
$this->artisan(Names::ACTIONS, ['--before' => true])->assertExitCode(0);

$this->assertDatabaseCount($table, 1);
$this->assertDatabaseCount($this->table, 11);
$this->assertDatabaseMigrationHas($this->table, 'test_before_enabled');
$this->assertDatabaseMigrationDoesntLike($this->table, 'test_before_disabled');
$this->artisan(Names::MIGRATE, ['--before' => true])->assertExitCode(0);
$this->artisan(Names::ACTIONS, ['--before' => true])->assertExitCode(0);

$this->artisan(Names::ROLLBACK)->assertExitCode(0);

Expand All @@ -281,7 +281,7 @@ public function testDI(): void
$this->assertDatabaseMigrationDoesntLike($table, 'up_down', column: 'value');
$this->assertDatabaseMigrationDoesntLike($table, 'invoke_down', column: 'value');
$this->assertDatabaseMigrationDoesntLike($table, 'invoke', column: 'value');
$this->artisan(Names::MIGRATE)->assertExitCode(0);
$this->artisan(Names::ACTIONS)->assertExitCode(0);

$this->assertDatabaseCount($table, 3);
$this->assertDatabaseCount($this->table, 3);
Expand Down
2 changes: 1 addition & 1 deletion tests/Commands/StatusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testStatusCommand()
$this->artisan(Names::STATUS)->expectsTable([], [])->assertExitCode(0);

$this->artisan(Names::MAKE, ['name' => 'Status'])->assertExitCode(0);
$this->artisan(Names::MIGRATE)->assertExitCode(0);
$this->artisan(Names::ACTIONS)->assertExitCode(0);

$this->assertDatabaseCount($this->table, 1);

Expand Down