release aufiting
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
it('does not contain duplicate migration filenames', function (): void {
|
||||
$files = array_merge(
|
||||
glob(database_path('migrations/*.php')) ?: [],
|
||||
glob(base_path('Modules/*/Database/Migrations/*.php')) ?: [],
|
||||
);
|
||||
|
||||
$duplicates = collect($files)
|
||||
->groupBy(fn (string $file): string => basename($file))
|
||||
->filter(fn ($group): bool => $group->count() > 1)
|
||||
->keys()
|
||||
->values()
|
||||
->all();
|
||||
|
||||
expect($duplicates)->toBe([]);
|
||||
});
|
||||
|
||||
it('uses unique migration class names', function (): void {
|
||||
$files = array_merge(
|
||||
glob(database_path('migrations/*.php')) ?: [],
|
||||
glob(base_path('Modules/*/Database/Migrations/*.php')) ?: [],
|
||||
);
|
||||
|
||||
foreach ($files as $file) {
|
||||
expect((string) file_get_contents($file))->not->toContain('class CreateMigration');
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user