Skip to content

Commit

Permalink
Fix for deprecation Connection::tablePrefix() is deprecated (#979)
Browse files Browse the repository at this point in the history
  • Loading branch information
divya-intelli authored Nov 15, 2023
1 parent 94a25a9 commit 647289b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ protected function syslogWrapper($level, $entry) {
$log_path = \Drupal::service('file_system')->realpath('public://');
}
// Add test prefix to the log file.
// @phpstan-ignore-next-line
$log_path .= '/apigee_edge_debug-' . str_replace('test', '', $this->database->tablePrefix()) . '.log';
$log_path .= '/apigee_edge_debug-' . str_replace('test', '', $this->database->getPrefix()) . '.log';
// Do not fail a test just because the fail is not writable.
@error_log($entry . PHP_EOL, 3, $log_path);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ protected function syslogWrapper($level, $entry) {
$log_path = \Drupal::service('file_system')->realpath('public://');
}
// Add test id as a suffix to the log file.
// @todo tablePrefix() is deprecated in Drupal 10.1
// @phpstan-ignore-next-line
$log_path .= '/syslog-' . str_replace('test', '', $this->database->tablePrefix()) . '.log';
$log_path .= '/syslog-' . str_replace('test', '', $this->database->getPrefix()) . '.log';
// Do not fail a test just because the fail is not writable.
@error_log($entry . PHP_EOL, 3, $log_path);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ public function createScreenshot($filename_prefix = '', $set_background_color =
}
/** @var \Drupal\Core\Database\Connection $database */
$database = $this->container->get('database');
// @todo tablePrefix() is deprecated in Drupal 10.1
// @phpstan-ignore-next-line
$test_id = str_replace('test', '', $database->tablePrefix());
$test_id = str_replace('test', '', $database->getPrefix());
// Add table suffix (test id) to the file name and ensure the generated
// file name is unique.
$filename = \Drupal::service('file_system')
Expand Down

0 comments on commit 647289b

Please sign in to comment.