Skip to content

Commit

Permalink
Merge branch '5.4' into 6.2
Browse files Browse the repository at this point in the history
* 5.4:
  Add test cases for MariaDBPlatform
  • Loading branch information
derrabus committed Jun 8, 2023
2 parents 3a5ed31 + 708ed45 commit 0dd8013
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
15 changes: 9 additions & 6 deletions Tests/Types/UlidTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Bridge\Doctrine\Tests\Types;

use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\MariaDBPlatform;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
Expand Down Expand Up @@ -140,13 +141,15 @@ public function testGetGuidTypeDeclarationSQL(AbstractPlatform $platform, string
$this->assertEquals($expectedDeclaration, $this->type->getSqlDeclaration(['length' => 36], $platform));
}

public static function provideSqlDeclarations(): array
public static function provideSqlDeclarations(): \Generator
{
return [
[new PostgreSQLPlatform(), 'UUID'],
[new SqlitePlatform(), 'BLOB'],
[new MySQLPlatform(), 'BINARY(16)'],
];
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 testRequiresSQLCommentHint()
Expand Down
15 changes: 9 additions & 6 deletions Tests/Types/UuidTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Bridge\Doctrine\Tests\Types;

use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\MariaDBPlatform;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
Expand Down Expand Up @@ -152,13 +153,15 @@ public function testGetGuidTypeDeclarationSQL(AbstractPlatform $platform, string
$this->assertEquals($expectedDeclaration, $this->type->getSqlDeclaration(['length' => 36], $platform));
}

public static function provideSqlDeclarations(): array
public static function provideSqlDeclarations(): \Generator
{
return [
[new PostgreSQLPlatform(), 'UUID'],
[new SqlitePlatform(), 'BLOB'],
[new MySQLPlatform(), 'BINARY(16)'],
];
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 testRequiresSQLCommentHint()
Expand Down

0 comments on commit 0dd8013

Please sign in to comment.