Skip to content

Commit

Permalink
test with an array
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmastech committed Feb 2, 2025
1 parent 8d65bc3 commit 024466f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/Integration/Migration/MigratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,22 @@ public function testMigrateWithoutOutput()
$this->assertTrue(DB::getSchemaBuilder()->hasColumn('people', 'last_name'));
}

#[TestWith(['2015_10_04_000000_modify_people_table.php'], 'filename with extension')]
#[TestWith(['2015_10_04_000000_modify_people_table'], 'filename without extension')]
public function testWithSkippedMigrations(string $filename)
public function testWithSkippedMigrations()
{
$this->app->forgetInstance('migrator');
$this->subject = $this->app->make('migrator');

Migrator::withoutMigrations([$filename]);
Migrator::withoutMigrations(['2015_10_04_000000_modify_people_table.php', '2016_10_04_000000_modify_people_table']);

$this->subject->run([__DIR__.'/fixtures']);
$this->assertTrue(DB::getSchemaBuilder()->hasTable('people'));
$this->assertFalse(DB::getSchemaBuilder()->hasColumn('people', 'first_name'));
$this->assertTrue(DB::getSchemaBuilder()->hasColumn('people', 'last_name'));
$this->assertFalse(DB::getSchemaBuilder()->hasColumn('people', 'last_name'));

Migrator::withoutMigrations([]);
$this->subject->run([__DIR__.'/fixtures']);
$this->assertTrue(DB::getSchemaBuilder()->hasColumn('people', 'first_name'));
$this->assertTrue(DB::getSchemaBuilder()->hasColumn('people', 'last_name'));
}

public function testRollback()
Expand Down

0 comments on commit 024466f

Please sign in to comment.