public function testOnPostUp() { $optionsPath = realpath(__DIR__ . '/../Fixtures') . '/test_options.yml'; $commandExecutor = $this->getMockBuilder('Oro\\Bundle\\EntityConfigBundle\\Tools\\CommandExecutor')->disableOriginalConstructor()->getMock(); $postUpMigrationListener = new UpdateExtendConfigPostUpMigrationListener($commandExecutor, $optionsPath); $connection = $this->getMockBuilder('Doctrine\\DBAL\\Connection')->disableOriginalConstructor()->getMock(); $event = new PostMigrationEvent($connection); $event->addMigration(new TestMigration()); $postUpMigrationListener->onPostUp($event); $migrations = $event->getMigrations(); $this->assertCount(2, $migrations); $this->assertEquals(new TestMigration(), $migrations[0]); $this->assertEquals(new UpdateExtendConfigMigration($commandExecutor, $optionsPath), $migrations[1]); }
public function testWarmUpCache() { $commandExecutor = $this->getMockBuilder('Oro\\Bundle\\EntityConfigBundle\\Tools\\CommandExecutor')->disableOriginalConstructor()->getMock(); $postUpMigrationListener = new PostUpMigrationListener($commandExecutor); $connection = $this->getMockBuilder('Doctrine\\DBAL\\Connection')->disableOriginalConstructor()->getMock(); $event = new PostMigrationEvent($connection); $event->addMigration(new TestMigration()); $postUpMigrationListener->warmUpCache($event); $migrations = $event->getMigrations(); $this->assertNotEmpty($event); $this->assertCount(2, $migrations); $this->assertInstanceOf('Oro\\Bundle\\EntityExtendBundle\\Tests\\Unit\\Fixtures\\TestMigration', $migrations[0]); $this->assertInstanceOf('Oro\\Bundle\\EntityConfigBundle\\Migration\\WarmUpEntityConfigCacheMigration', $migrations[1]); $this->assertEquals(new TestMigration(), $migrations[0]); $this->assertEquals(new WarmUpEntityConfigCacheMigration($commandExecutor), $migrations[1]); }
/** * POST UP event handler * * @param PostMigrationEvent $event */ public function onPostUp(PostMigrationEvent $event) { $event->addMigration(new UpdateExtendConfigMigration($this->commandExecutor, $this->configProcessorOptionsPath, $this->initialEntityConfigStatePath)); }
/** * POST UP event handler * * @param PostMigrationEvent $event */ public function onPostUp(PostMigrationEvent $event) { $event->addMigration(new UpdateExtendIndicesMigration($this->entityMetadataHelper, $this->fieldTypeHelper)); }
/** * POST UP event handler * * @param PostMigrationEvent $event */ public function onPostUp(PostMigrationEvent $event) { $event->addMigration(new UpdateEntityConfigMigration($this->commandExecutor)); }
/** * Registers a migration to warm up entity configs cache * * @param PostMigrationEvent $event */ public function warmUpCache(PostMigrationEvent $event) { $event->addMigration(new WarmUpEntityConfigCacheMigration($this->commandExecutor)); }
/** * @param PostMigrationEvent $event */ public function onPostUp(PostMigrationEvent $event) { if ($this->dataMigration) { $event->addMigration($this->dataMigration); } }
/** * POST UP event handler * * @param PostMigrationEvent $event */ public function onPostUp(PostMigrationEvent $event) { $event->addMigration(new ActivityListMigration($this->provider, $this->activityListExtension, $this->metadataHelper, $this->nameGenerator, $this->configManager)); }
/** * POST UP event handler * * @param PostMigrationEvent $event */ public function onPostUp(PostMigrationEvent $event) { $event->addMigration(new RefreshExtendCacheMigration($this->commandExecutor, $this->configManager)); }
/** * POST UP event handler * * @param PostMigrationEvent $event */ public function onPostUp(PostMigrationEvent $event) { $event->addMigration(new RefreshExtendCacheMigration($this->commandExecutor, $this->configManager, $this->initialEntityConfigStatePath)); }
/** * POST UP event handler * * @param PostMigrationEvent $event */ public function onPostUp(PostMigrationEvent $event) { $event->addMigration(new ActivityContactMigration($this->metadataHelper, $this->activityContactProvider)); }