Changeset 41818
- Timestamp:
- 10/10/2017 11:45:35 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/dbdelta.php
r40339 r41818 362 362 } 363 363 364 $table_name = 'test_truncated_index'; 365 366 $create = "CREATE TABLE $table_name (\n a varchar(255) COLLATE utf8mb4_unicode_ci,\n KEY a (a)\n)"; 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"; 375 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 ); 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 } 370 387 371 388 $this->assertSame( array(), $actual );
Note: See TracChangeset
for help on using the changeset viewer.