Skip to content

Commit

Permalink
Ad-hoc DB report: Automatically fix test queries for MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
marxjohnson committed Dec 13, 2023
1 parent a7701e1 commit ccf619c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/behat/behat_report_customsql.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ public function the_following_custom_sql_report_exists(TableNode $data) {
throw new Exception('The report SQL must be given as querysql.');
}

// Fix test queries containing CHR for MySQL & chums.
if ($DB->get_dbfamily() == 'mysql' && stripos($report['querysql'], 'CHR') !== false) {
$report['querysql'] = str_ireplace('CHR', 'CHAR', $report['querysql']);
}

// Category.
if (isset($report['category'])) {
$report['categoryid'] = $this->get_category_id_by_name($report['category']);
Expand Down

0 comments on commit ccf619c

Please sign in to comment.