Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ jobs:
php-version: "8.2"
mysql-version: "9.1"
extension: "mysqli"
- config-file-suffix: "-stringify_fetches"
php-version: "8.2"
mysql-version: "9.1"
extension: "pdo_mysql"
- php-version: "8.2"
mysql-version: "9.1"
extension: "mysqli"
Expand Down
37 changes: 37 additions & 0 deletions ci/github/phpunit/pdo_mysql-stringify_fetches.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="true"
failOnNotice="true"
failOnPhpunitDeprecation="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
>
<php>
<ini name="error_reporting" value="-1" />

<var name="db_driver" value="pdo_mysql"/>
<!-- see \PDO::ATTR_STRINGIFY_FETCHES-->
<var name="db_driver_option_17" value="true"/>
<var name="db_host" value="127.0.0.1" />
<var name="db_port" value="3306"/>
<var name="db_user" value="root" />
<var name="db_dbname" value="doctrine_tests" />
<var name="db_charset" value="utf8mb4" />
</php>

<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>../../../tests</directory>
</testsuite>
</testsuites>

<source>
<include>
<directory>../../../src</directory>
</include>
</source>
</phpunit>
22 changes: 22 additions & 0 deletions tests/Functional/Schema/MySQLSchemaManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Doctrine\DBAL\Tests\Functional\Schema\MySQL\CustomType;
use Doctrine\DBAL\Tests\Functional\Schema\MySQL\PointType;
use Doctrine\DBAL\Tests\TestUtil;
use Doctrine\DBAL\Types\BinaryType;
use Doctrine\DBAL\Types\BlobType;
use Doctrine\DBAL\Types\FloatType;
use Doctrine\DBAL\Types\JsonType;
Expand Down Expand Up @@ -546,6 +547,27 @@ public function testListUnsignedFloatTypeColumns(): void
self::assertTrue($columns['col_smallfloat_unsigned']->getUnsigned());
}

public function testConfigurableLengthColumns(): void
{
$table = Table::editor()
->setUnquotedName('test_configurable_length_columns')
->setColumns(
Column::editor()
->setUnquotedName('col_binary')
->setTypeName(Types::BINARY)
->setLength(16)
->create(),
)
->create();

$this->dropAndCreateTable($table);

$columns = $this->schemaManager->listTableColumns('test_configurable_length_columns');

self::assertInstanceOf(BinaryType::class, $columns['col_binary']->getType());
self::assertSame(16, $columns['col_binary']->getLength());
}

public function testJsonColumnType(): void
{
$table = Table::editor()
Expand Down
Loading