Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5 from roxblnfk/feature/tests
Browse files Browse the repository at this point in the history
Added test for duplicated migrations by file name or class name
  • Loading branch information
wolfy-j authored Nov 19, 2019
2 parents d7a9cef + 71c0ff2 commit 286c9b8
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/Migrations/ExceptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,19 @@ public function testBadMigrationFile()
/**
* @expectedException \Spiral\Migrations\Exception\RepositoryException
*/
public function testDuplicateMigration()
public function testDuplicateClassMigration()
{
$this->repository->registerMigration('m', DuplicateColumnMigration::class);
$this->repository->registerMigration('m', DuplicateColumnMigration::class);
$this->repository->registerMigration('unique_name_1', DuplicateColumnMigration::class);
$this->repository->registerMigration('unique_name_2', DuplicateColumnMigration::class);
}

/**
* @expectedException \Spiral\Migrations\Exception\RepositoryException
*/
public function testDuplicateFileNameMigration()
{
$this->repository->registerMigration('camel_case_duplicate', DuplicateColumnMigration::class);
$this->repository->registerMigration('camelCaseDuplicate', CreateEmptyMigration::class);
}

/**
Expand Down

0 comments on commit 286c9b8

Please sign in to comment.