Changeset 37525 for trunk/tests/phpunit/tests/dbdelta.php
- Timestamp:
- 05/23/2016 08:35:59 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/dbdelta.php
r36552 r37525 32 32 id bigint(20) NOT NULL AUTO_INCREMENT, 33 33 column_1 varchar(255) NOT NULL, 34 column_2 text, 35 column_3 blob, 34 36 PRIMARY KEY (id), 35 37 KEY key_1 (column_1), … … 363 365 $this->assertSame( array(), $actual ); 364 366 } 367 368 /** 369 * @ticket 36748 370 */ 371 function test_dont_downsize_text_fields() { 372 global $wpdb; 373 374 $result = dbDelta( 375 " 376 CREATE TABLE {$wpdb->prefix}dbdelta_test ( 377 id bigint(20) NOT NULL AUTO_INCREMENT, 378 column_1 varchar(255) NOT NULL, 379 column_2 tinytext, 380 column_3 blob, 381 PRIMARY KEY (id), 382 KEY key_1 (column_1), 383 KEY compound_key (id,column_1), 384 FULLTEXT KEY fulltext_key (column_1) 385 ) ENGINE=MyISAM 386 ", false ); 387 388 $this->assertSame( array(), $result ); 389 } 390 391 /** 392 * @ticket 36748 393 */ 394 function test_dont_downsize_blob_fields() { 395 global $wpdb; 396 397 $result = dbDelta( 398 " 399 CREATE TABLE {$wpdb->prefix}dbdelta_test ( 400 id bigint(20) NOT NULL AUTO_INCREMENT, 401 column_1 varchar(255) NOT NULL, 402 column_2 text, 403 column_3 tinyblob, 404 PRIMARY KEY (id), 405 KEY key_1 (column_1), 406 KEY compound_key (id,column_1), 407 FULLTEXT KEY fulltext_key (column_1) 408 ) ENGINE=MyISAM 409 ", false ); 410 411 $this->assertSame( array(), $result ); 412 } 413 414 /** 415 * @ticket 36748 416 */ 417 function test_upsize_text_fields() { 418 global $wpdb; 419 420 $result = dbDelta( 421 " 422 CREATE TABLE {$wpdb->prefix}dbdelta_test ( 423 id bigint(20) NOT NULL AUTO_INCREMENT, 424 column_1 varchar(255) NOT NULL, 425 column_2 bigtext, 426 column_3 blob, 427 PRIMARY KEY (id), 428 KEY key_1 (column_1), 429 KEY compound_key (id,column_1), 430 FULLTEXT KEY fulltext_key (column_1) 431 ) ENGINE=MyISAM 432 ", false ); 433 434 $this->assertSame( 435 array( 436 "{$wpdb->prefix}dbdelta_test.column_2" 437 => "Changed type of {$wpdb->prefix}dbdelta_test.column_2 from text to bigtext" 438 ), $result ); 439 } 440 441 /** 442 * @ticket 36748 443 */ 444 function test_upsize_blob_fields() { 445 global $wpdb; 446 447 $result = dbDelta( 448 " 449 CREATE TABLE {$wpdb->prefix}dbdelta_test ( 450 id bigint(20) NOT NULL AUTO_INCREMENT, 451 column_1 varchar(255) NOT NULL, 452 column_2 text, 453 column_3 mediumblob, 454 PRIMARY KEY (id), 455 KEY key_1 (column_1), 456 KEY compound_key (id,column_1), 457 FULLTEXT KEY fulltext_key (column_1) 458 ) ENGINE=MyISAM 459 ", false ); 460 461 $this->assertSame( 462 array( 463 "{$wpdb->prefix}dbdelta_test.column_3" 464 => "Changed type of {$wpdb->prefix}dbdelta_test.column_3 from blob to mediumblob" 465 ), $result ); 466 } 365 467 }
Note: See TracChangeset
for help on using the changeset viewer.