Changeset 45607 for trunk/tests/phpunit/tests/dbdelta.php
- Timestamp:
- 07/08/2019 12:55:20 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/dbdelta.php
r43571 r45607 34 34 // Forcing MyISAM, because InnoDB only started supporting FULLTEXT indexes in MySQL 5.7. 35 35 $wpdb->query( 36 " 37 CREATE TABLE {$wpdb->prefix}dbdelta_test ( 38 id bigint(20) NOT NULL AUTO_INCREMENT, 39 column_1 varchar(255) NOT NULL, 40 column_2 text, 41 column_3 blob, 42 PRIMARY KEY (id), 43 KEY key_1 (column_1($this->max_index_length)), 44 KEY compound_key (id,column_1($this->max_index_length)), 45 FULLTEXT KEY fulltext_key (column_1) 46 ) ENGINE=MyISAM 47 " 36 $wpdb->prepare( 37 " 38 CREATE TABLE {$wpdb->prefix}dbdelta_test ( 39 id bigint(20) NOT NULL AUTO_INCREMENT, 40 column_1 varchar(255) NOT NULL, 41 column_2 text, 42 column_3 blob, 43 PRIMARY KEY (id), 44 KEY key_1 (column_1(%d)), 45 KEY compound_key (id,column_1(%d)), 46 FULLTEXT KEY fulltext_key (column_1) 47 ) ENGINE=MyISAM 48 ", 49 $this->max_index_length, 50 $this->max_index_length 51 ) 48 52 ); 49 53 … … 300 304 global $wpdb; 301 305 306 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared 302 307 $table_row = $wpdb->get_row( "select $column from {$table} where $column = '$value'" ); 303 308 … … 318 323 global $wpdb; 319 324 320 $table_fields = $wpdb->get_results( "DESCRIBE {$table}" ); 325 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared 326 $table_fields = $wpdb->get_results( "DESCRIBE $table" ); 321 327 322 328 $this->assertCount( 1, wp_list_filter( $table_fields, array( 'Field' => $column ) ) ); … … 334 340 global $wpdb; 335 341 336 $table_indices = $wpdb->get_results( "SHOW INDEX FROM {$table}" ); 342 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared 343 $table_indices = $wpdb->get_results( "SHOW INDEX FROM $table" ); 337 344 338 345 $this->assertCount( … … 359 366 global $wpdb; 360 367 361 $table_fields = $wpdb->get_results( "DESCRIBE {$table}" ); 368 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared 369 $table_fields = $wpdb->get_results( "DESCRIBE $table" ); 362 370 363 371 $this->assertCount( 0, wp_list_filter( $table_fields, array( 'Field' => $column ) ) ); … … 386 394 ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC"; 387 395 396 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared 388 397 $wpdb->query( $create ); 389 398 399 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared 390 400 $index = $wpdb->get_row( "SHOW INDEXES FROM $table_name WHERE Key_name='a_key';" ); 391 401 392 402 $actual = dbDelta( $create, false ); 393 403 404 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared 394 405 $wpdb->query( "DROP TABLE IF EXISTS $table_name;" ); 395 406 396 if ( 191 != $index->Sub_part ) {407 if ( 191 !== $index->Sub_part ) { 397 408 $this->markTestSkipped( 'This test requires the index to be truncated.' ); 398 409 } … … 528 539 "; 529 540 541 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared 530 542 $wpdb->query( $schema ); 531 543 … … 557 569 "; 558 570 571 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared 559 572 $wpdb->query( $schema ); 560 573 … … 603 616 "; 604 617 618 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared 605 619 $wpdb->query( $schema ); 606 620 … … 999 1013 "; 1000 1014 1015 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared 1001 1016 $wpdb->query( $schema ); 1002 1017
Note: See TracChangeset
for help on using the changeset viewer.