diff --git a/tests/system/Database/Live/ForgeTest.php b/tests/system/Database/Live/ForgeTest.php index 9383b46af2bb..c7ea8fc4510b 100644 --- a/tests/system/Database/Live/ForgeTest.php +++ b/tests/system/Database/Live/ForgeTest.php @@ -249,8 +249,16 @@ public function testCreateTableWithArrayFieldConstraints() public function testCreateTableWithNullableFieldsGivesNullDataType(): void { $this->forge->addField([ - 'id' => ['type' => 'INT', 'constraint' => 11, 'auto_increment' => true], - 'name' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true], + 'id' => [ + 'type' => 'INT', + 'constraint' => 11, + 'auto_increment' => true, + ], + 'name' => [ + 'type' => 'VARCHAR', + 'constraint' => 255, + 'null' => true, + ], ]); $createTable = $this->getPrivateMethodInvoker($this->forge, '_createTable'); @@ -620,7 +628,13 @@ public function testAddFields() $this->assertEquals($fieldsData[0]->type, 'int'); $this->assertEquals($fieldsData[1]->type, 'varchar'); - $this->assertEquals($fieldsData[0]->max_length, 11); + if (version_compare($this->db->getVersion(), '8.0.17', '<')) + { + // As of MySQL 8.0.17, the display width attribute for integer data types + // is deprecated and is not reported back anymore. + // @see https://dev.mysql.com/doc/refman/8.0/en/numeric-type-attributes.html + $this->assertEquals($fieldsData[0]->max_length, 11); + } $this->assertNull($fieldsData[0]->default); $this->assertNull($fieldsData[1]->default);