Ticket #41716: 41716.3.diff
File 41716.3.diff, 1.2 KB (added by , 7 years ago) |
---|
-
tests/phpunit/tests/dbdelta.php
361 361 $this->markTestSkipped( 'This test requires utf8mb4 support in MySQL.' ); 362 362 } 363 363 364 $table_name = 'test_truncated_index'; 364 // This table needs to be actually created 365 remove_filter( 'query', array( $this, '_create_temporary_tables' ) ); 366 remove_filter( 'query', array( $this, '_drop_temporary_tables' ) ); 367 368 $table_name = "{$wpdb->prefix}test_truncated_index"; 369 370 $create = " 371 CREATE TABLE $table_name ( 372 a varchar(255) COLLATE utf8mb4_unicode_ci, 373 KEY a_key (a) 374 ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; 365 375 366 $create = "CREATE TABLE $table_name (\n a varchar(255) COLLATE utf8mb4_unicode_ci,\n KEY a (a)\n)";367 376 $wpdb->query( $create ); 368 377 378 $index = $wpdb->get_row( "SHOW INDEXES FROM $table_name WHERE Key_name='a_key';" ); 379 369 380 $actual = dbDelta( $create, false ); 370 381 382 $wpdb->query( "DROP TABLE IF EXISTS $table_name;" ); 383 384 if ( 191 != $index->Sub_part ) { 385 $this->markTestSkipped( "This test requires the index to be truncated." ); 386 } 387 371 388 $this->assertSame( array(), $actual ); 372 389 } 373 390