Implement loading existing migration classes from the filesystem

[MAILPOET-4466]
This commit is contained in:
Jan Jakes
2022-10-27 16:04:16 +02:00
committed by Aschepikov
parent 516c460ace
commit e9970f3cc8
8 changed files with 73 additions and 0 deletions

View File

@ -55,6 +55,18 @@ class RepositoryTest extends MailPoetUnitTest {
$repository->create();
}
public function testItLoadsMigrationFiles(): void {
$repository = $this->make(Repository::class, [
'migrationsDir' => __DIR__ . '/TestMigrations',
]);
$this->assertSame([
'Migration_1',
'Migration_2',
'Migration_3',
'Migration_4',
], $repository->loadAll());
}
public function _after() {
parent::_after();
$this->removeDir(self::MIGRATIONS_OUTPUT_DIR);