Skip to content

Commit

Permalink
rename event
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Feb 3, 2020
1 parent 7b84d4a commit 739fcea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Illuminate\Database\Events;

class NoMigrations
class NoPendingMigrations
{
/**
* The migration method that was called.
Expand Down
6 changes: 3 additions & 3 deletions src/Illuminate/Database/Migrations/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Illuminate\Database\Events\MigrationsEnded;
use Illuminate\Database\Events\MigrationsStarted;
use Illuminate\Database\Events\MigrationStarted;
use Illuminate\Database\Events\NoMigrations;
use Illuminate\Database\Events\NoPendingMigrations;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
Expand Down Expand Up @@ -140,7 +140,7 @@ public function runPending(array $migrations, array $options = [])
// aren't, we will just make a note of it to the developer so they're aware
// that all of the migrations have been run against this database system.
if (count($migrations) === 0) {
$this->fireMigrationEvent(new NoMigrations('up'));
$this->fireMigrationEvent(new NoPendingMigrations('up'));

$this->note('<info>Nothing to migrate.</info>');

Expand Down Expand Up @@ -224,7 +224,7 @@ public function rollback($paths = [], array $options = [])
$migrations = $this->getMigrationsForRollback($options);

if (count($migrations) === 0) {
$this->fireMigrationEvent(new NoMigrations('down'));
$this->fireMigrationEvent(new NoPendingMigrations('down'));

$this->note('<info>Nothing to rollback.</info>');

Expand Down
6 changes: 3 additions & 3 deletions tests/Integration/Database/MigratorEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Database\Events\MigrationsEnded;
use Illuminate\Database\Events\MigrationsStarted;
use Illuminate\Database\Events\MigrationStarted;
use Illuminate\Database\Events\NoMigrations;
use Illuminate\Database\Events\NoPendingMigrations;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Event;

Expand Down Expand Up @@ -61,10 +61,10 @@ public function testTheNoMigrationEventIsFiredWhenNothingToMigrate()
$this->artisan('migrate');
$this->artisan('migrate:rollback');

Event::assertDispatched(NoMigrations::class, function ($event) {
Event::assertDispatched(NoPendingMigrations::class, function ($event) {
return $event->method == 'up';
});
Event::assertDispatched(NoMigrations::class, function ($event) {
Event::assertDispatched(NoPendingMigrations::class, function ($event) {
return $event->method == 'down';
});
}
Expand Down

0 comments on commit 739fcea

Please sign in to comment.