diff --git a/tests/Functional/Schema/MySQLSchemaManagerTest.php b/tests/Functional/Schema/MySQLSchemaManagerTest.php index 6eb97a6bc90..df041485bb3 100644 --- a/tests/Functional/Schema/MySQLSchemaManagerTest.php +++ b/tests/Functional/Schema/MySQLSchemaManagerTest.php @@ -15,7 +15,9 @@ use Doctrine\DBAL\Tests\Functional\Schema\MySQL\PointType; use Doctrine\DBAL\Tests\TestUtil; use Doctrine\DBAL\Types\BlobType; +use Doctrine\DBAL\Types\FloatType; use Doctrine\DBAL\Types\JsonType; +use Doctrine\DBAL\Types\RealFloatType; use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types; @@ -370,40 +372,22 @@ public function testListDecimalTypeColumns(): void self::assertTrue($columns['col_unsigned']->getUnsigned()); } - public function testListFloatTypeColumns(): void + public function testListUnsignedFloatTypeColumns(): void { - $tableName = 'test_list_float_columns'; + $tableName = 'test_unsigned_float_columns'; $table = new Table($tableName); - $table->addColumn('col', Types::FLOAT); $table->addColumn('col_unsigned', Types::FLOAT, ['unsigned' => true]); + $table->addColumn('col_real_unsigned', Types::REAL, ['unsigned' => true]); $this->dropAndCreateTable($table); $columns = $this->schemaManager->listTableColumns($tableName); - self::assertArrayHasKey('col', $columns); - self::assertArrayHasKey('col_unsigned', $columns); - self::assertFalse($columns['col']->getUnsigned()); - self::assertTrue($columns['col_unsigned']->getUnsigned()); - } - - public function testListRealFloatTypeColumns(): void - { - $tableName = 'test_list_real_columns'; - $table = new Table($tableName); - - $table->addColumn('col', Types::REAL); - $table->addColumn('col_unsigned', Types::REAL, ['unsigned' => true]); - - $this->dropAndCreateTable($table); - - $columns = $this->schemaManager->listTableColumns($tableName); - - self::assertArrayHasKey('col', $columns); - self::assertArrayHasKey('col_unsigned', $columns); - self::assertFalse($columns['col']->getUnsigned()); + self::assertInstanceOf(FloatType::class, $columns['col_unsigned']->getType()); + self::assertInstanceOf(RealFloatType::class, $columns['col_real_unsigned']->getType()); self::assertTrue($columns['col_unsigned']->getUnsigned()); + self::assertTrue($columns['col_real_unsigned']->getUnsigned()); } public function testJsonColumnType(): void diff --git a/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php b/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php index fb642b8d054..41469aa5edc 100644 --- a/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php +++ b/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php @@ -863,16 +863,19 @@ public function testListTableWithBlob(): void public function testListTableFloatTypeColumns(): void { - $table = new Table('test_float_table'); + $tableName = 'test_float_columns'; + $table = new Table($tableName); $table->addColumn('col_float', Types::FLOAT); $table->addColumn('col_real_float', Types::REAL); $this->dropAndCreateTable($table); - $columns = $this->schemaManager->listTableColumns('test_float_table'); + $columns = $this->schemaManager->listTableColumns($tableName); self::assertInstanceOf(FloatType::class, $columns['col_float']->getType()); self::assertInstanceOf(RealFloatType::class, $columns['col_real_float']->getType()); + self::assertFalse($columns['col_float']->getUnsigned()); + self::assertFalse($columns['col_real_float']->getUnsigned()); } /** @param mixed[] $data */ diff --git a/tests/Types/RealFloatTest.php b/tests/Types/RealFloatTest.php index 32041784ce1..3013a0d9f3c 100644 --- a/tests/Types/RealFloatTest.php +++ b/tests/Types/RealFloatTest.php @@ -22,9 +22,7 @@ protected function setUp(): void public function testFloatConvertsToPHPValue(): void { - $result = $this->type->convertToPHPValue('5.5', $this->platform); - self::assertIsFloat($result); - self::assertEquals(5.5, $result); + self::assertEquals(5.5, $this->type->convertToPHPValue('5.5', $this->platform)); } public function testFloatNullConvertsToPHPValue(): void