Skip to content

Commit

Permalink
test: add tests for "migrate:rollback -b"
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Jun 12, 2024
1 parent ce3750c commit d2e50af
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/system/Commands/DatabaseCommandsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,24 @@ public function testMigrate(): void
$this->assertStringContainsString('Migrations complete.', $this->getBuffer());
}

public function testMigrateRollbackValidBatchNumber(): void
{
command('migrate --all');
$this->clearBuffer();

command('migrate:rollback -b 1');
$this->assertStringContainsString('Done rolling back migrations.', $this->getBuffer());
}

public function testMigrateRollbackInvalidBatchNumber(): void
{
command('migrate --all');
$this->clearBuffer();

command('migrate:rollback -b x');
$this->assertStringContainsString('Invalid batch number: x', $this->getBuffer());
}

public function testMigrateRollback(): void
{
command('migrate --all -g tests');
Expand Down

0 comments on commit d2e50af

Please sign in to comment.