diff --git a/tests/system/Commands/DatabaseCommandsTest.php b/tests/system/Commands/DatabaseCommandsTest.php index 1ccdea9251ee..02d6e6b38963 100644 --- a/tests/system/Commands/DatabaseCommandsTest.php +++ b/tests/system/Commands/DatabaseCommandsTest.php @@ -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');