aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_framework
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_framework')
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php32
1 files changed, 27 insertions, 5 deletions
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index 937192c58f..d6eb4a632f 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -192,7 +192,7 @@ class phpbb_functional_test_case extends phpbb_test_case
$db_tools,
self::$config['table_prefix'] . 'migrations',
$phpbb_root_path,
- $php_ext,
+ $phpEx,
self::$config['table_prefix'],
array(),
new \phpbb\db\migration\helper()
@@ -207,7 +207,7 @@ class phpbb_functional_test_case extends phpbb_test_case
new phpbb\filesystem(),
self::$config['table_prefix'] . 'ext',
dirname(__FILE__) . '/',
- $php_ext,
+ $phpEx,
$this->get_cache_driver()
);
@@ -473,6 +473,16 @@ class phpbb_functional_test_case extends phpbb_test_case
global $config;
$config = new \phpbb\config\config(array());
+
+ /*
+ * 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'] = '';
$config['rand_seed_last_update'] = time() + 600;
@@ -716,15 +726,27 @@ class phpbb_functional_test_case extends phpbb_test_case
/**
* assertContains for language strings
*
- * @param string $needle Search string
- * @param string $haystack Search this
- * @param string $message Optional failure message
+ * @param string $needle Search string
+ * @param string $haystack Search this
+ * @param string $message Optional failure message
*/
public function assertContainsLang($needle, $haystack, $message = null)
{
$this->assertContains(html_entity_decode($this->lang($needle), ENT_QUOTES), $haystack, $message);
}
+ /**
+ * assertNotContains for language strings
+ *
+ * @param string $needle Search string
+ * @param string $haystack Search this
+ * @param string $message Optional failure message
+ */
+ public function assertNotContainsLang($needle, $haystack, $message = null)
+ {
+ $this->assertNotContains(html_entity_decode($this->lang($needle), ENT_QUOTES), $haystack, $message);
+ }
+
/*
* Perform some basic assertions for the page
*