@@ -249,8 +249,16 @@ public function testCreateTableWithArrayFieldConstraints()
249249 public function testCreateTableWithNullableFieldsGivesNullDataType (): void
250250 {
251251 $ this ->forge ->addField ([
252- 'id ' => ['type ' => 'INT ' , 'constraint ' => 11 , 'auto_increment ' => true ],
253- 'name ' => ['type ' => 'VARCHAR ' , 'constraint ' => 255 , 'null ' => true ],
252+ 'id ' => [
253+ 'type ' => 'INT ' ,
254+ 'constraint ' => 11 ,
255+ 'auto_increment ' => true ,
256+ ],
257+ 'name ' => [
258+ 'type ' => 'VARCHAR ' ,
259+ 'constraint ' => 255 ,
260+ 'null ' => true ,
261+ ],
254262 ]);
255263
256264 $ createTable = $ this ->getPrivateMethodInvoker ($ this ->forge , '_createTable ' );
@@ -620,7 +628,13 @@ public function testAddFields()
620628 $ this ->assertEquals ($ fieldsData [0 ]->type , 'int ' );
621629 $ this ->assertEquals ($ fieldsData [1 ]->type , 'varchar ' );
622630
623- $ this ->assertEquals ($ fieldsData [0 ]->max_length , 11 );
631+ if (version_compare ($ this ->db ->getVersion (), '8.0.17 ' , '< ' ))
632+ {
633+ // As of MySQL 8.0.17, the display width attribute for integer data types
634+ // is deprecated and is not reported back anymore.
635+ // @see https://dev.mysql.com/doc/refman/8.0/en/numeric-type-attributes.html
636+ $ this ->assertEquals ($ fieldsData [0 ]->max_length , 11 );
637+ }
624638
625639 $ this ->assertNull ($ fieldsData [0 ]->default );
626640 $ this ->assertNull ($ fieldsData [1 ]->default );
0 commit comments