Migration1673946817FixMediaFolderAssociationFields example

protected function setUp(): void
    {
        if (Feature::isActive('v6.6.0.0')) {
            static::markTestSkipped('This test is not compatible with v6.6.0.0. Re-enable when migration refactoring is complete or remove the unit test with next major.');
        }

        $this->connection = KernelLifecycleManager::getConnection();
    }

    public function testGetCreationTimestamp(): void
    {
        $migration = new Migration1673946817FixMediaFolderAssociationFields();
        static::assertEquals('1673946817', $migration->getCreationTimestamp());
    }

    public function testFieldsAreMigrated(): void
    {
        $migration = new Migration1673946817FixMediaFolderAssociationFields();
        $migration->update($this->connection);

        $fields = $this->connection->fetchOne('SELECT association_fields FROM media_default_folder WHERE entity = :user', ['user' => 'user']);

        static::assertJson($fields);
        
Home | Imprint | This part of the site doesn't use cookies.