mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 13:28:55 +00:00
[feature/dbal-tests] Only output the missing config error message once.
The error message was also not properly escaping the variables, thus producing an incorrect example configuration file.
This commit is contained in:
parent
53ab8886b1
commit
2bbfa9c29f
1 changed files with 18 additions and 6 deletions
|
@ -20,16 +20,28 @@ class phpbb_test_case_helpers
|
|||
|
||||
public function get_database_config()
|
||||
{
|
||||
static $show_error = true;
|
||||
|
||||
if (!file_exists('test_config.php'))
|
||||
{
|
||||
if ($show_error)
|
||||
{
|
||||
$show_error = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->test_case->markTestSkipped('Missing test_config.php: See first error.');
|
||||
return;
|
||||
}
|
||||
|
||||
trigger_error("You have to create a test_config.php like this:
|
||||
\"<?php
|
||||
$dbms = 'mysqli';
|
||||
$dbhost = 'localhost';
|
||||
$dbport = '';
|
||||
$dbname = 'database';
|
||||
$dbuser = 'user';
|
||||
$dbpasswd = 'password';
|
||||
\$dbms = 'mysqli';
|
||||
\$dbhost = 'localhost';
|
||||
\$dbport = '';
|
||||
\$dbname = 'database';
|
||||
\$dbuser = 'user';
|
||||
\$dbpasswd = 'password';
|
||||
\"
|
||||
|
||||
NOTE: The database is dropped and recreated with the phpbb-db-schema! Do NOT specify a database with important data.", E_USER_ERROR);
|
||||
|
|
Loading…
Add table
Reference in a new issue