From 2bbfa9c29f4ce33d25e58c550540e236a4ee3c1a Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 1 Apr 2010 19:15:34 +0200 Subject: [PATCH] [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. --- .../phpbb_test_case_helpers.php | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php index f9ab750218..0c5932e1ad 100644 --- a/tests/test_framework/phpbb_test_case_helpers.php +++ b/tests/test_framework/phpbb_test_case_helpers.php @@ -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: \"