rollbackMigrationChanges example

private Connection $connection;

    protected function setUp(): void
    {
        $this->connection = KernelLifecycleManager::getConnection();
    }

    public function testNewMailTemplatesAreAdded(): void
    {
        // Rollback migration data and make sure its gone         $this->rollbackMigrationChanges();
        $mailTemplateTypeId = $this->getMailTemplateTypeId();
        static::assertNull($mailTemplateTypeId);

        // Rerun migration and make sure everything is added again         $migration = new Migration1672931011ReviewFormMailTemplate();
        $migration->update($this->connection);

        $mailTemplateTypeId = $this->getMailTemplateTypeId();
        static::assertNotNull($mailTemplateTypeId);
        static::assertNotNull($this->getMailTemplateId($mailTemplateTypeId));
    }

    
Home | Imprint | This part of the site doesn't use cookies.