Changeset 37574 for trunk/tests/phpunit/tests/dbdelta.php
- Timestamp:
- 05/26/2016 04:58:13 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/dbdelta.php
r37538 r37574 489 489 $this->assertEmpty( $updates ); 490 490 } 491 492 /** 493 * @ticket 36948 494 */ 495 function test_spatial_indices() { 496 global $wpdb; 497 498 if ( version_compare( $wpdb->db_version(), '5.4', '<' ) ) { 499 $this->markTestSkipped( 'Spatial indices require MySQL 5.4 and above.' ); 500 } 501 502 $schema = 503 " 504 CREATE TABLE {$wpdb->prefix}spatial_index_test ( 505 non_spatial bigint(20) unsigned NOT NULL, 506 spatial_value geometrycollection NOT NULL, 507 KEY non_spatial (non_spatial), 508 SPATIAL KEY spatial_key (spatial_value) 509 ) ENGINE=MyISAM; 510 "; 511 512 $wpdb->query( $schema ); 513 514 $updates = dbDelta( $schema, false ); 515 516 $this->assertEmpty( $updates ); 517 518 $schema = 519 " 520 CREATE TABLE {$wpdb->prefix}spatial_index_test ( 521 non_spatial bigint(20) unsigned NOT NULL, 522 spatial_value geometrycollection NOT NULL, 523 spatial_value2 geometrycollection NOT NULL, 524 KEY non_spatial (non_spatial), 525 SPATIAL KEY spatial_key (spatial_value) 526 SPATIAL KEY spatial_key2 (spatial_value2) 527 ) ENGINE=MyISAM; 528 "; 529 530 $updates = dbDelta( $schema, false ); 531 532 $this->assertSame( array( 533 "{$wpdb->prefix}spatial_index_test.spatial_value2" => "Added column {$wpdb->prefix}spatial_index_test.spatial_value2", 534 "Added index {$wpdb->prefix}spatial_index_test SPATIAL KEY spatial_key2 (spatial_value2)" 535 ), $updates ); 536 537 $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}spatial_index_test" ); 538 } 491 539 }
Note: See TracChangeset
for help on using the changeset viewer.