public function register(Application $app) { $app['doctrine-migration.configuration'] = $app->share(function ($app) { $configuration = new YamlConfiguration($app['orm.em']->getConnection()); $configuration->load(__DIR__ . '/../../../../conf.d/migrations.yml'); $configuration->setMigrationsDirectory(__DIR__ . '/../../../../Alchemy/Phrasea/Setup/DoctrineMigration'); return $configuration; }); }
/** * @dataProvider provideVariousFixtures */ public function testApply($fixture) { $em = $this->loadFixture($fixture); $upgrader = new Upgrade39Users(); $configuration = new YamlConfiguration($em->getConnection()); $configuration->load(__DIR__ . '/../../../../../../../lib/conf.d/migrations.yml'); $configuration->setMigrationsDirectory(__DIR__ . '/../../../../../../../lib/Alchemy/Phrasea/Setup/DoctrineMigration'); $upgrader->apply($em, $this->createAppboxMock(), $configuration); $this->assertUsrTableIsSanitized($em); // check usr_ids are preserved $this->assertUsridsArePreserved($em); $this->checkThatNewConstraintsCanBeApplied($em); $this->assertLastAppliedModelAreOk($em); $this->assertTemplateAreOwnedByValidUser($em); $this->assertEquals('onner316269684', $this->loadUser($em, 30)->getLogin()); $this->assertTrue($this->loadUser($em, 30)->isDeleted()); }