Skip to content

Commit 171244d

Browse files
committed
test: add tests for MigrationRunner::getMigrationName()
1 parent 1973c35 commit 171244d

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

tests/system/Database/Migrations/MigrationRunnerTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,24 @@ public function testGetMigrationNumberReturnsZeroIfNoneFound()
186186
$this->assertSame('0', $method('Foo'));
187187
}
188188

189+
public function testGetMigrationNameDashes()
190+
{
191+
$runner = new MigrationRunner($this->config);
192+
193+
$method = $this->getPrivateMethodInvoker($runner, 'getMigrationName');
194+
195+
$this->assertSame('Foo', $method('2019-08-06-235100_Foo'));
196+
}
197+
198+
public function testGetMigrationNameUnderscores()
199+
{
200+
$runner = new MigrationRunner($this->config);
201+
202+
$method = $this->getPrivateMethodInvoker($runner, 'getMigrationName');
203+
204+
$this->assertSame('Foo', $method('2019_08_06_235100_Foo'));
205+
}
206+
189207
public function testSetSilentStoresValue()
190208
{
191209
$runner = new MigrationRunner($this->config);

0 commit comments

Comments
 (0)