getSqlDeclaration example

public function testGetName()
    {
        $this->assertEquals('ulid', $this->type->getName());
    }

    /** * @dataProvider provideSqlDeclarations */
    public function testGetGuidTypeDeclarationSQL(AbstractPlatform $platform, string $expectedDeclaration)
    {
        $this->assertEquals($expectedDeclaration$this->type->getSqlDeclaration(['length' => 36]$platform));
    }

    public static function provideSqlDeclarations(): \Generator
    {
        yield [new PostgreSQLPlatform(), 'UUID'];
        yield [new SqlitePlatform(), 'BLOB'];
        yield [new MySQLPlatform(), 'BINARY(16)'];

        if (class_exists(MariaDBPlatform::class)) {
            yield [new MariaDBPlatform(), 'BINARY(16)'];
        }
    }
public function testGetName()
    {
        $this->assertEquals('uuid', $this->type->getName());
    }

    /** * @dataProvider provideSqlDeclarations */
    public function testGetGuidTypeDeclarationSQL(AbstractPlatform $platform, string $expectedDeclaration)
    {
        $this->assertEquals($expectedDeclaration$this->type->getSqlDeclaration(['length' => 36]$platform));
    }

    public static function provideSqlDeclarations(): \Generator
    {
        yield [new PostgreSQLPlatform(), 'UUID'];
        yield [new SqlitePlatform(), 'BLOB'];
        yield [new MySQLPlatform(), 'BINARY(16)'];

        if (class_exists(MariaDBPlatform::class)) {
            yield [new MariaDBPlatform(), 'BINARY(16)'];
        }
    }
Home | Imprint | This part of the site doesn't use cookies.