Skip to content

Commit 5b2833d

Browse files
committed
Restore lost function
1 parent 7cdaa1b commit 5b2833d

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/AntiMattr/MongoDB/Migrations/Tools/Console/Command/StatusCommand.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,14 @@ public function execute(InputInterface $input, OutputInterface $output)
144144
->setRows($rows)
145145
->render();
146146
}
147+
148+
$executedUnavailableMigrations = $configuration->getUnavailableMigratedVersions();
149+
if ($executedUnavailableMigrations) {
150+
$output->writeln("\n <info>==</info> Previously Executed Unavailable Migration Versions\n");
151+
foreach ($executedUnavailableMigrations as $executedUnavailableMigration) {
152+
$output->writeln(' <comment>>></comment> '.Configuration::formatVersion($executedUnavailableMigration).' (<comment>'.$executedUnavailableMigration.'</comment>)');
153+
}
154+
}
147155
}
148156
}
149157

tests/AntiMattr/Tests/MongoDB/Migrations/Tools/Console/Command/StatusCommandTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,14 @@ public function testExecuteWithShowingVersions()
290290
)
291291
)
292292
;
293+
$this->config->expects($this->once())
294+
->method('getUnavailableMigratedVersions')
295+
->will(
296+
$this->returnValue(
297+
array($unavailableMigratedVersion)
298+
)
299+
)
300+
;
293301
$this->config->expects($this->once())
294302
->method('getMigrations')
295303
->will(
@@ -433,6 +441,21 @@ public function testExecuteWithShowingVersions()
433441
->with("\n <info>==</info> Available Migration Versions\n")
434442
;
435443

444+
$this->output->expects($this->at(39))
445+
->method('writeln')
446+
->with("\n <info>==</info> Previously Executed Unavailable Migration Versions\n")
447+
;
448+
$this->output->expects($this->at(40))
449+
->method('writeln')
450+
->with(
451+
sprintf(
452+
' <comment>>></comment> %s (<comment>%s</comment>)',
453+
\DateTime::createFromFormat('YmdHis', $unavailableMigratedVersion)->format('Y-m-d H:i:s'),
454+
$unavailableMigratedVersion
455+
)
456+
)
457+
;
458+
436459
// Run command, run.
437460
$this->command->run(
438461
$input,

0 commit comments

Comments
 (0)