mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 14:28:56 +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()
|
public function get_database_config()
|
||||||
{
|
{
|
||||||
|
static $show_error = true;
|
||||||
|
|
||||||
if (!file_exists('test_config.php'))
|
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:
|
trigger_error("You have to create a test_config.php like this:
|
||||||
\"<?php
|
\"<?php
|
||||||
$dbms = 'mysqli';
|
\$dbms = 'mysqli';
|
||||||
$dbhost = 'localhost';
|
\$dbhost = 'localhost';
|
||||||
$dbport = '';
|
\$dbport = '';
|
||||||
$dbname = 'database';
|
\$dbname = 'database';
|
||||||
$dbuser = 'user';
|
\$dbuser = 'user';
|
||||||
$dbpasswd = 'password';
|
\$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);
|
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