public function testItLogsInfoIfAllMigrationsWereSuccessfullyExecuted() { $this->migrator->expects($this->once())->method('needsToRun')->willReturn(true); $this->migrator->expects($this->once())->method('migrate')->willReturn(42); $this->mutex->expects($this->once())->method('acquire')->willReturn(true); $this->mutex->expects($this->once())->method('release')->willReturn(true); $this->logger->expects($this->once())->method('info')->with($this->stringContains('42')); $mediator = new Mediator($this->migrator, $this->mutex, $this->logger); $mediator->negotiate(); }
/** * Executes migrations * * @return void */ private function executeMigrations() { if ($this->migrator->needsToRun()) { $latestVersion = $this->migrator->migrate(); $this->logger->info('Migrate all migrations up to version ' . $latestVersion . '.'); } }