specifications) { $this->specifications->delete(); } parent::tearDown(); } public function testMigrateFails() { $migration = $this->getMigration(); try { $migration->migrate(); $this->fail('Should fail'); } catch (\LogicException $e) { } } public function testMigrate() { $config = __DIR__ . '/configuration.yml'; $compiled = __DIR__ . '/configuration.yml.php'; @unlink($config); @unlink($compiled); $this->specifications = new Configuration(new Yaml(), new Compiler(), $config, $compiled, true); $this->assertFalse($this->specifications->isSetup()); $this->goBackTo35(); $app = new Application(Application::ENV_TEST); $migration = $this->getMigration($app); $migration->migrate(); @unlink(__DIR__ . '/../../../../../../config/config.inc.old'); @unlink(__DIR__ . '/../../../../../../config/connexion.inc.old'); $this->assertTrue($this->specifications->isSetup()); @unlink($config); @unlink($compiled); } private function getMigration(Application $app = null) { $app = $app ? : new Application(Application::ENV_TEST); if ($this->specifications) { $app['configuration.store'] = $this->specifications; } return new Migration35($app); } }