@@ -24,6 +24,7 @@ public static function setUpBeforeClass(): void {
2424 $ GLOBALS ['wpdb ' ]->suppress_errors = false ;
2525 $ GLOBALS ['wpdb ' ]->show_errors = true ;
2626 }
27+ return ;
2728 }
2829
2930 // Before each test, we create a new database
@@ -92,7 +93,7 @@ public function testRegexps( $operator, $regexp, $expected_result ) {
9293 );
9394 }
9495
95- public function regexpOperators () {
96+ public static function regexpOperators () {
9697 $ lowercase_rss = (object ) array (
9798 'ID ' => '1 ' ,
9899 'option_name ' => 'rss_123 ' ,
@@ -255,26 +256,27 @@ public function testSelectFromDual() {
255256 public function testShowCreateTable1 () {
256257 $ this ->assertQuery (
257258 "CREATE TABLE _tmp_table (
258- ID BIGINT PRIMARY KEY AUTO_INCREMENT NOT NULL,
259- option_name VARCHAR(255) default '',
260- option_value TEXT NOT NULL,
261- UNIQUE KEY option_name (option_name),
262- KEY composite (option_name, option_value)
263- ); "
259+ ID BIGINT PRIMARY KEY AUTO_INCREMENT NOT NULL,
260+ option_name VARCHAR(255) default '',
261+ option_value TEXT NOT NULL,
262+ UNIQUE KEY option_name (option_name),
263+ KEY composite (option_name, option_value)
264+ ); "
264265 );
265266
266267 $ this ->assertQuery (
267268 'SHOW CREATE TABLE _tmp_table; '
268269 );
269270 $ results = $ this ->engine ->get_query_results ();
271+ # TODO: Should we fix mismatch with original `option_value` text NOT NULL,` without default?
270272 $ this ->assertEquals (
271273 "CREATE TABLE _tmp_table (
272- `ID` bigint PRIMARY KEY AUTO_INCREMENT NOT NULL,
273- `option_name` varchar(255) DEFAULT '',
274- `option_value` text NOT NULL,
275- KEY _tmp_table__composite (option_name, option_value),
276- UNIQUE KEY _tmp_table__option_name (option_name)
277- ); " ,
274+ `ID` bigint PRIMARY KEY AUTO_INCREMENT NOT NULL,
275+ `option_name` varchar(255) DEFAULT '',
276+ `option_value` text NOT NULL DEFAULT '' ,
277+ KEY _tmp_table__composite (option_name, option_value),
278+ UNIQUE KEY _tmp_table__option_name (option_name)
279+ ); " ,
278280 $ results [0 ]->{'Create Table ' }
279281 );
280282 }
@@ -323,7 +325,7 @@ public function testShowCreateTableWithAlterAndCreateIndex() {
323325 'CREATE TABLE _tmp_table (
324326 `ID` bigint PRIMARY KEY AUTO_INCREMENT NOT NULL,
325327 `option_name` smallint NOT NULL DEFAULT 14,
326- `option_value` text NOT NULL,
328+ `option_value` text NOT NULL DEFAULT \'\' ,
327329 KEY _tmp_table__option_name (option_name)
328330); ' ,
329331 $ results [0 ]->{'Create Table ' }
0 commit comments