private function migrate(stdClass $jsonData, $targetVersion) { try { $this->migrationManager->migrate($jsonData, $targetVersion); } catch (MigrationFailedException $e) { throw new ConversionFailedException(sprintf('Could not migrate the JSON data: %s', $e->getMessage()), 0, $e); } }
public function testMigrateDoesNothingIfAlreadyCorrectVersion() { $data = (object) array(); $this->versioner->expects($this->once())->method('parseVersion')->with($data)->willReturn('0.10'); $this->versioner->expects($this->never())->method('updateVersion'); $this->migration1->expects($this->never())->method('up'); $this->migration2->expects($this->never())->method('up'); $this->migration3->expects($this->never())->method('up'); $this->migration1->expects($this->never())->method('down'); $this->migration2->expects($this->never())->method('down'); $this->migration3->expects($this->never())->method('down'); $this->manager->migrate($data, '0.10'); }