From ca92ed918a57605e969f0485b1ebca53806f0729 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 12 Mar 2014 19:09:29 +0100 Subject: [ticket/12176] Add newest_user_colour to config array to ensure it exists PHPBB3-12176 --- tests/test_framework/phpbb_functional_test_case.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/test_framework/phpbb_functional_test_case.php') diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 00b31212b2..857112f29e 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -423,6 +423,13 @@ class phpbb_functional_test_case extends phpbb_test_case $config = array(); } + /* + * We need add some configs into the config array here, otherwise + * the set_config() function will try to add the value to the database, + * because some DBMS return 0 for sql_affectedrows() when a row was found, + * but not changed. + */ + $config['newest_user_colour'] = ''; $config['rand_seed'] = ''; $config['rand_seed_last_update'] = time() + 600; -- cgit v1.2.1 From e123b0c0a0791ac68b6099c2942eba8f6acbf56b Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 13 Mar 2014 00:53:07 +0100 Subject: [ticket/12176] Reword comment about config entries. PHPBB3-12176 --- tests/test_framework/phpbb_functional_test_case.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tests/test_framework/phpbb_functional_test_case.php') diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 857112f29e..5dfe07d380 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -424,10 +424,12 @@ class phpbb_functional_test_case extends phpbb_test_case } /* - * We need add some configs into the config array here, otherwise - * the set_config() function will try to add the value to the database, - * because some DBMS return 0 for sql_affectedrows() when a row was found, - * but not changed. + * Add required config entries to the config array to prevent + * set_config() sending an INSERT query for already existing entries, + * resulting in a SQL error. + * This is because set_config() first sends an UPDATE query, then checks + * sql_affectedrows() which can be 0 (e.g. on MySQL) when the new + * data is already there. */ $config['newest_user_colour'] = ''; $config['rand_seed'] = ''; -- cgit v1.2.1