Ejemplo n.º 1
0
 /**
  * @dataProvider provideVariousFixtures
  */
 public function testApply($fixture)
 {
     $this->loadFixture($fixture);
     $em = $this->createEntityManager();
     $upgrader = new Upgrade39Users();
     $upgrader->apply($em, $this->createAppboxMock(), self::$DI['cli']['doctrine-migration.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());
 }
Ejemplo n.º 2
0
 /**
  * @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());
 }