Skip to content

Commit d2e50af

Browse files
committed
test: add tests for "migrate:rollback -b"
1 parent ce3750c commit d2e50af

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/system/Commands/DatabaseCommandsTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,24 @@ public function testMigrate(): void
5353
$this->assertStringContainsString('Migrations complete.', $this->getBuffer());
5454
}
5555

56+
public function testMigrateRollbackValidBatchNumber(): void
57+
{
58+
command('migrate --all');
59+
$this->clearBuffer();
60+
61+
command('migrate:rollback -b 1');
62+
$this->assertStringContainsString('Done rolling back migrations.', $this->getBuffer());
63+
}
64+
65+
public function testMigrateRollbackInvalidBatchNumber(): void
66+
{
67+
command('migrate --all');
68+
$this->clearBuffer();
69+
70+
command('migrate:rollback -b x');
71+
$this->assertStringContainsString('Invalid batch number: x', $this->getBuffer());
72+
}
73+
5674
public function testMigrateRollback(): void
5775
{
5876
command('migrate --all -g tests');

0 commit comments

Comments
 (0)