Skip to content

Commit

Permalink
Add failing tests for MySQL variables used by UpdraftPlus plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonpayton committed Apr 30, 2024
1 parent 037f6ef commit c89b57c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/WP_SQLite_Translator_Tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -2245,4 +2245,34 @@ public function testDefaultNullValue() {
$result
);
}

/**
* @dataProvider mysqlVariablesToTest
*/
public function testSelectVariable( $variable_name ) {
$this->assertQuery( "SELECT $variable_name;" );
// TODO: Assert about results once we provide them
}

public static function mysqlVariablesToTest() {
return array(
// TODO: generate variable name permutations with mixed letter casing
// NOTE: This list was derived from the variables used by the UpdraftPlus plugin.
// We will start here and plan to expand supported variables over time.
array( '@@character_set_client' ),
array( '@@character_set_results' ),
array( '@@collation_connection' ),
array( '@@GLOBAL.gtid_purged' ),
array( '@@GLOBAL.log_bin' ),
array( '@@GLOBAL.log_bin_trust_function_creators' ),
array( '@@GLOBAL.sql_mode' ),
array( '@@SESSION.max_allowed_packet' ),
array( '@@SESSION.sql_mode' ),
);
}

// TODO:
//public function testSelectUnsupportedVariable() {
// // TODO

Check failure on line 2276 in tests/WP_SQLite_Translator_Tests.php

View workflow job for this annotation

GitHub Actions / Check code style

Spaces must be used for mid-line alignment; tabs are not allowed
//}
}

Check failure on line 2278 in tests/WP_SQLite_Translator_Tests.php

View workflow job for this annotation

GitHub Actions / Check code style

Spaces must be used for mid-line alignment; tabs are not allowed

0 comments on commit c89b57c

Please sign in to comment.