From c3fb0f359ca8e39ff9c4c3ffbd9e4e899075cd57 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Tue, 12 Jun 2012 00:41:00 -0400 Subject: [ticket/10933] Specify empty template path for absolute includephp test. This was probably necessary all along, and the test happened to work because state was not correctly reset between test runs and a previous test set an empty template path. PHPBB3-10933 --- tests/template/includephp_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/template/includephp_test.php b/tests/template/includephp_test.php index 626735f15f..f008a734eb 100644 --- a/tests/template/includephp_test.php +++ b/tests/template/includephp_test.php @@ -36,7 +36,7 @@ class phpbb_template_includephp_test extends phpbb_template_template_test_case $this->setup_engine(array('tpl_allow_php' => true)); - $this->style->set_custom_style('tests', $cache_dir); + $this->style->set_custom_style('tests', $cache_dir, ''); $cache_file = $this->template->cachepath . 'includephp_absolute.html.php'; $this->run_template('includephp_absolute.html', array(), array(), array(), "Path is absolute.\ntesting included php", $cache_file); -- cgit v1.2.1 From 767d09227bd848da21dc3e255b1dacd20cbad1f7 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Fri, 2 Nov 2012 18:51:35 -0400 Subject: [ticket/10933] Dependency inject template context. PHPBB3-10933 --- tests/extension/metadata_manager_test.php | 3 ++- tests/template/template_test_case.php | 2 +- tests/template/template_test_case_with_tree.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php index 9865f14314..ce7be0dea5 100644 --- a/tests/extension/metadata_manager_test.php +++ b/tests/extension/metadata_manager_test.php @@ -43,7 +43,8 @@ class metadata_manager_test extends phpbb_database_test_case $this->phpEx, $this->config, $this->user, - new phpbb_style_resource_locator() + new phpbb_style_resource_locator(), + new phpbb_template_context() ); $this->extension_manager = new phpbb_extension_manager( diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php index 6f76cb049d..2e6f703eb1 100644 --- a/tests/template/template_test_case.php +++ b/tests/template/template_test_case.php @@ -67,7 +67,7 @@ class phpbb_template_template_test_case extends phpbb_test_case $this->template_path = $this->test_path . '/templates'; $this->style_resource_locator = new phpbb_style_resource_locator(); $this->style_provider = new phpbb_style_path_provider(); - $this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator); + $this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, new phpbb_template_context()); $this->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template); $this->style->set_custom_style('tests', $this->template_path, ''); } diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php index 05ccb7ee55..6a226f317a 100644 --- a/tests/template/template_test_case_with_tree.php +++ b/tests/template/template_test_case_with_tree.php @@ -22,7 +22,7 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat $this->parent_template_path = $this->test_path . '/parent_templates'; $this->style_resource_locator = new phpbb_style_resource_locator(); $this->style_provider = new phpbb_style_path_provider(); - $this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator); + $this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, new phpbb_template_context()); $this->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template); $this->style->set_custom_style('tests', array($this->template_path, $this->parent_template_path), ''); } -- cgit v1.2.1 From a7babc211c975dc6aead4740046afd593d90cc78 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Tue, 6 Nov 2012 10:41:06 -0500 Subject: [ticket/11159] static public is the currently approved order. PHPBB3-11159 --- tests/dbal/select_test.php | 16 ++++++++-------- tests/dbal/write_test.php | 4 ++-- tests/privmsgs/delete_user_pms_test.php | 2 +- tests/request/request_var_test.php | 2 +- tests/security/extract_current_page_test.php | 2 +- tests/security/redirect_test.php | 2 +- tests/template/template_test.php | 4 ++-- tests/test_framework/phpbb_database_test_case.php | 2 +- tests/text_processing/make_clickable_test.php | 2 +- tests/utf/utf8_clean_string_test.php | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) (limited to 'tests') diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php index 81cd13b006..6dbab05a41 100644 --- a/tests/dbal/select_test.php +++ b/tests/dbal/select_test.php @@ -17,7 +17,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/three_users.xml'); } - public static function return_on_error_select_data() + static public function return_on_error_select_data() { return array( array('phpbb_users', "username_clean = 'bertie'", array(array('username_clean' => 'bertie'))), @@ -44,7 +44,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case $this->assertEquals($expected, $db->sql_fetchrowset($result)); } - public static function fetchrow_data() + static public function fetchrow_data() { return array( array('', array(array('username_clean' => 'barfoo'), @@ -95,7 +95,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case $db->sql_freeresult($result); } - public static function fetchfield_data() + static public function fetchfield_data() { return array( array('', array('barfoo', 'foobar', 'bertie')), @@ -125,7 +125,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case $this->assertEquals($expected, $ary); } - public static function fetchfield_seek_data() + static public function fetchfield_seek_data() { return array( array(1, 'foobar'), @@ -151,7 +151,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case $this->assertEquals($expected, $field); } - public static function query_limit_data() + static public function query_limit_data() { return array( array(0, 0, array(array('username_clean' => 'barfoo'), @@ -192,7 +192,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case $this->assertEquals($expected, $ary); } - public static function like_expression_data() + static public function like_expression_data() { // * = any_char; # = one_char return array( @@ -229,7 +229,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case $db->sql_freeresult($result); } - public static function in_set_data() + static public function in_set_data() { return array( array('user_id', 3, false, false, array(array('username_clean' => 'bertie'))), @@ -303,7 +303,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case $db->sql_freeresult($result); } - public static function build_array_data() + static public function build_array_data() { return array( array(array('username_clean' => 'barfoo'), array(array('username_clean' => 'barfoo'))), diff --git a/tests/dbal/write_test.php b/tests/dbal/write_test.php index 596c50a220..ecfd774896 100644 --- a/tests/dbal/write_test.php +++ b/tests/dbal/write_test.php @@ -16,7 +16,7 @@ class phpbb_dbal_write_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/config.xml'); } - public static function build_array_insert_data() + static public function build_array_insert_data() { return array( array(array( @@ -104,7 +104,7 @@ class phpbb_dbal_write_test extends phpbb_database_test_case $db->sql_freeresult($result); } - public static function update_data() + static public function update_data() { return array( array( diff --git a/tests/privmsgs/delete_user_pms_test.php b/tests/privmsgs/delete_user_pms_test.php index 265df1596a..f705825262 100644 --- a/tests/privmsgs/delete_user_pms_test.php +++ b/tests/privmsgs/delete_user_pms_test.php @@ -16,7 +16,7 @@ class phpbb_privmsgs_delete_user_pms_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/delete_user_pms.xml'); } - public static function delete_user_pms_data() + static public function delete_user_pms_data() { return array( // array( diff --git a/tests/request/request_var_test.php b/tests/request/request_var_test.php index 8e609c00af..0c07fe11a3 100644 --- a/tests/request/request_var_test.php +++ b/tests/request/request_var_test.php @@ -73,7 +73,7 @@ class phpbb_request_request_var_test extends phpbb_test_case unset($_GET[$var], $_POST[$var], $_REQUEST[$var], $_COOKIE[$var]); } - public static function request_variables() + static public function request_variables() { return array( // strings diff --git a/tests/security/extract_current_page_test.php b/tests/security/extract_current_page_test.php index 4911f7b452..0f5128884b 100644 --- a/tests/security/extract_current_page_test.php +++ b/tests/security/extract_current_page_test.php @@ -14,7 +14,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/session.php'; class phpbb_security_extract_current_page_test extends phpbb_security_test_base { - public static function security_variables() + static public function security_variables() { return array( array('http://localhost/phpBB/index.php', 'mark=forums&x=">', 'mark=forums&x=%22%3E%3Cscript%3Ealert(/XSS/);%3C/script%3E'), diff --git a/tests/security/redirect_test.php b/tests/security/redirect_test.php index 4848a938c6..872a331dc7 100644 --- a/tests/security/redirect_test.php +++ b/tests/security/redirect_test.php @@ -14,7 +14,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/session.php'; class phpbb_security_redirect_test extends phpbb_security_test_base { - public static function provider() + static public function provider() { // array(Input -> redirect(), expected triggered error (else false), expected returned result url (else false)) return array( diff --git a/tests/template/template_test.php b/tests/template/template_test.php index aaee7bb4a0..9b3c6ac245 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -94,7 +94,7 @@ class phpbb_template_template_test extends phpbb_test_case /** * @todo put test data into templates/xyz.test */ - public static function template_data() + static public function template_data() { return array( /* @@ -419,7 +419,7 @@ class phpbb_template_template_test extends phpbb_test_case $GLOBALS['config']['tpl_allow_php'] = false; } - public static function alter_block_array_data() + static public function alter_block_array_data() { return array( array( diff --git a/tests/test_framework/phpbb_database_test_case.php b/tests/test_framework/phpbb_database_test_case.php index bb86df0ef0..75a3c0944b 100644 --- a/tests/test_framework/phpbb_database_test_case.php +++ b/tests/test_framework/phpbb_database_test_case.php @@ -137,7 +137,7 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test * * @return string The string with the specified match converted to uppercase */ - public static function to_upper($matches) + static public function to_upper($matches) { return $matches[1] . strtoupper($matches[2]) . $matches[3]; } diff --git a/tests/text_processing/make_clickable_test.php b/tests/text_processing/make_clickable_test.php index 8697907311..db0812319d 100644 --- a/tests/text_processing/make_clickable_test.php +++ b/tests/text_processing/make_clickable_test.php @@ -12,7 +12,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php'; class phpbb_text_processing_make_clickable_test extends phpbb_test_case { - public static function make_clickable_data() + static public function make_clickable_data() { // value => whether it should work $prefix_texts = array( diff --git a/tests/utf/utf8_clean_string_test.php b/tests/utf/utf8_clean_string_test.php index 70bd549d5b..5ebf6409af 100644 --- a/tests/utf/utf8_clean_string_test.php +++ b/tests/utf/utf8_clean_string_test.php @@ -11,7 +11,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php'; class phpbb_utf_utf8_clean_string_test extends phpbb_test_case { - public static function cleanable_strings() + static public function cleanable_strings() { return array( array('MiXed CaSe', 'mixed case', 'Checking case folding'), -- cgit v1.2.1 From 644662bc2cee77de5e43134635b82fe5acd03538 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Tue, 6 Nov 2012 16:43:48 -0500 Subject: [ticket/11159] Static public is the currently approved order. PHPBB3-11159 --- tests/cron/ext/testext/cron/dummy_task.php | 2 +- tests/cron/includes/cron/task/core/dummy_task.php | 2 +- tests/cron/includes/cron/task/core/second_dummy_task.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/cron/ext/testext/cron/dummy_task.php b/tests/cron/ext/testext/cron/dummy_task.php index a31806c1b1..3e81db1895 100644 --- a/tests/cron/ext/testext/cron/dummy_task.php +++ b/tests/cron/ext/testext/cron/dummy_task.php @@ -9,7 +9,7 @@ class phpbb_ext_testext_cron_dummy_task extends phpbb_cron_task_base { - public static $was_run = 0; + static public $was_run = 0; public function get_name() { diff --git a/tests/cron/includes/cron/task/core/dummy_task.php b/tests/cron/includes/cron/task/core/dummy_task.php index ce3e91a9ba..c94455603f 100644 --- a/tests/cron/includes/cron/task/core/dummy_task.php +++ b/tests/cron/includes/cron/task/core/dummy_task.php @@ -9,7 +9,7 @@ class phpbb_cron_task_core_dummy_task extends phpbb_cron_task_base { - public static $was_run = 0; + static public $was_run = 0; public function get_name() { diff --git a/tests/cron/includes/cron/task/core/second_dummy_task.php b/tests/cron/includes/cron/task/core/second_dummy_task.php index 76a55588f9..77ef6f70ed 100644 --- a/tests/cron/includes/cron/task/core/second_dummy_task.php +++ b/tests/cron/includes/cron/task/core/second_dummy_task.php @@ -9,7 +9,7 @@ class phpbb_cron_task_core_second_dummy_task extends phpbb_cron_task_base { - public static $was_run = 0; + static public $was_run = 0; public function get_name() { -- cgit v1.2.1 From 18a922c036f196e934fec1a1daab7cfaa98001ce Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Thu, 8 Nov 2012 10:14:29 -0500 Subject: [ticket/11174] Started on search tests - keyword splitting. PHPBB3-11174 --- tests/search/fixtures/posts.xml | 33 ++++++++++++ tests/search/native_test.php | 113 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 146 insertions(+) create mode 100644 tests/search/fixtures/posts.xml create mode 100644 tests/search/native_test.php (limited to 'tests') diff --git a/tests/search/fixtures/posts.xml b/tests/search/fixtures/posts.xml new file mode 100644 index 0000000000..875af55599 --- /dev/null +++ b/tests/search/fixtures/posts.xml @@ -0,0 +1,33 @@ + + + + post_username + post_subject + post_text + + foo + foo + foo + + + bar + bar + bar + +
+ + word_id + word_text + word_common + + 1 + foo + 0 + + + 2 + bar + 0 + +
+
diff --git a/tests/search/native_test.php b/tests/search/native_test.php new file mode 100644 index 0000000000..bcde11faf1 --- /dev/null +++ b/tests/search/native_test.php @@ -0,0 +1,113 @@ +must_contain_ids; } + public function get_must_not_contain_ids() { return \$this->must_not_contain_ids; } +} + "; + eval($code); + } + return $wrapped; +} + +class phpbb_search_native_test extends phpbb_database_test_case +{ + protected $db; + protected $search; + + public function getDataSet() + { + return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/posts.xml'); + } + + protected function setUp() + { + global $phpbb_root_path, $phpEx, $config, $user, $cache; + + parent::setUp(); + + // dbal uses cache + $cache = new phpbb_cache_driver_null; + + $this->db = $this->new_dbal(); + $error = null; + $class = phpbb_search_wrapper('phpbb_search_fulltext_native'); + $this->search = new $class($error, $phpbb_root_path, $phpEx, null, $config, $this->db, $user); + } + + protected function tearDown() + { + parent::tearDown(); + } + + public function keywords() + { + return array( + // keywords + // terms + // ok + // must contain ids + // must not contain ids + array( + 'foo', + 'all', + true, + array(1), + array(), + ), + array( + 'foo bar', + 'all', + true, + array(1, 2), + array(), + ), + array( + 'foo -bar', + 'all', + true, + array(1), + array(2), + ), + array( + '-foo', + 'all', + false, + array(), + array(), + ), + array( + '-foo -bar', + 'all', + false, + array(), + array(), + ), + ); + } + + /** + * @dataProvider keywords + */ + public function test_split_keywords($keywords, $terms, $ok, $must_contain, $must_not_contain) + { + $rv = $this->search->split_keywords($keywords, $terms); + $this->assertEquals($ok, $rv); + $this->assertEmpty(array_diff($must_contain, $this->search->get_must_contain_ids())); + $this->assertEmpty(array_diff($must_not_contain, $this->search->get_must_not_contain_ids())); + } +} -- cgit v1.2.1 From ed37141f512f857311b64bb283943634eba84525 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Thu, 8 Nov 2012 10:19:15 -0500 Subject: [ticket/11174] Clarify why that is the way it is. PHPBB3-11174 --- tests/search/native_test.php | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/search/native_test.php b/tests/search/native_test.php index bcde11faf1..15b4644498 100644 --- a/tests/search/native_test.php +++ b/tests/search/native_test.php @@ -107,6 +107,7 @@ class phpbb_search_native_test extends phpbb_database_test_case { $rv = $this->search->split_keywords($keywords, $terms); $this->assertEquals($ok, $rv); + // http://stackoverflow.com/questions/3838288/phpunit-assert-two-arrays-are-equal-but-order-of-elements-not-important $this->assertEmpty(array_diff($must_contain, $this->search->get_must_contain_ids())); $this->assertEmpty(array_diff($must_not_contain, $this->search->get_must_not_contain_ids())); } -- cgit v1.2.1 From 1aa0b4567fc1849712471e129b868927f400f773 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Thu, 8 Nov 2012 10:23:28 -0500 Subject: [ticket/11174] More tests. PHPBB3-11174 --- tests/search/native_test.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tests') diff --git a/tests/search/native_test.php b/tests/search/native_test.php index 15b4644498..8638a914ba 100644 --- a/tests/search/native_test.php +++ b/tests/search/native_test.php @@ -76,6 +76,29 @@ class phpbb_search_native_test extends phpbb_database_test_case array(1, 2), array(), ), + // leading, trailing and multiple spaces + array( + ' foo bar ', + 'all', + true, + array(1, 2), + array(), + ), + // words too short + array( + 'f', + 'all', + false, + array(), + array(), + ), + array( + 'f o o', + 'all', + false, + array(), + array(), + ), array( 'foo -bar', 'all', @@ -83,6 +106,7 @@ class phpbb_search_native_test extends phpbb_database_test_case array(1), array(2), ), + // all negative array( '-foo', 'all', -- cgit v1.2.1 From e523517e03d3f54daaa33b4e48743a0f065fba0f Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Thu, 8 Nov 2012 11:01:34 -0500 Subject: [ticket/11174] Test for common words. PHPBB3-11174 --- tests/search/fixtures/posts.xml | 10 ++++++++++ tests/search/native_test.php | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) (limited to 'tests') diff --git a/tests/search/fixtures/posts.xml b/tests/search/fixtures/posts.xml index 875af55599..7b249ee303 100644 --- a/tests/search/fixtures/posts.xml +++ b/tests/search/fixtures/posts.xml @@ -14,6 +14,11 @@ bar bar + + commonword + commonword + commonword + word_id @@ -29,5 +34,10 @@ bar0 + + 3 + commonword + 1 +
diff --git a/tests/search/native_test.php b/tests/search/native_test.php index 8638a914ba..3726b96a82 100644 --- a/tests/search/native_test.php +++ b/tests/search/native_test.php @@ -121,6 +121,22 @@ class phpbb_search_native_test extends phpbb_database_test_case array(), array(), ), + // all common + array( + 'commonword', + 'all', + false, + array(), + array(), + ), + // some common + array( + 'commonword foo', + 'all', + true, + array(1), + array(), + ), ); } -- cgit v1.2.1 From a5f7f99478a43206ab6021a80828dddf66f92e9f Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Thu, 8 Nov 2012 11:15:46 -0500 Subject: [ticket/11174] Check common words, fix array equality assertion. PHPBB3-11174 --- tests/search/native_test.php | 54 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 11 deletions(-) (limited to 'tests') diff --git a/tests/search/native_test.php b/tests/search/native_test.php index 3726b96a82..66972079cf 100644 --- a/tests/search/native_test.php +++ b/tests/search/native_test.php @@ -62,12 +62,14 @@ class phpbb_search_native_test extends phpbb_database_test_case // ok // must contain ids // must not contain ids + // common words array( 'foo', 'all', true, array(1), array(), + array(), ), array( 'foo bar', @@ -75,6 +77,7 @@ class phpbb_search_native_test extends phpbb_database_test_case true, array(1, 2), array(), + array(), ), // leading, trailing and multiple spaces array( @@ -83,21 +86,25 @@ class phpbb_search_native_test extends phpbb_database_test_case true, array(1, 2), array(), + array(), ), // words too short array( 'f', 'all', false, - array(), - array(), + null, + null, + // short words count as "common" words + array('f'), ), array( 'f o o', 'all', false, - array(), - array(), + null, + null, + array('f', 'o', 'o'), ), array( 'foo -bar', @@ -105,20 +112,23 @@ class phpbb_search_native_test extends phpbb_database_test_case true, array(1), array(2), + array(), ), // all negative array( '-foo', 'all', false, - array(), + null, + null, array(), ), array( '-foo -bar', 'all', false, - array(), + null, + null, array(), ), // all common @@ -126,8 +136,9 @@ class phpbb_search_native_test extends phpbb_database_test_case 'commonword', 'all', false, - array(), - array(), + null, + null, + array('commonword'), ), // some common array( @@ -136,6 +147,7 @@ class phpbb_search_native_test extends phpbb_database_test_case true, array(1), array(), + array('commonword'), ), ); } @@ -143,12 +155,32 @@ class phpbb_search_native_test extends phpbb_database_test_case /** * @dataProvider keywords */ - public function test_split_keywords($keywords, $terms, $ok, $must_contain, $must_not_contain) + public function test_split_keywords($keywords, $terms, $ok, $must_contain, $must_not_contain, $common) { $rv = $this->search->split_keywords($keywords, $terms); $this->assertEquals($ok, $rv); + if ($ok) + { + // only check criteria if the search is going to be performed + $this->assert_array_content_equals($must_contain, $this->search->get_must_contain_ids()); + $this->assert_array_content_equals($must_not_contain, $this->search->get_must_not_contain_ids()); + } + $this->assert_array_content_equals($common, $this->search->get_common_words()); + } + + public function assert_array_content_equals($one, $two) + { // http://stackoverflow.com/questions/3838288/phpunit-assert-two-arrays-are-equal-but-order-of-elements-not-important - $this->assertEmpty(array_diff($must_contain, $this->search->get_must_contain_ids())); - $this->assertEmpty(array_diff($must_not_contain, $this->search->get_must_not_contain_ids())); + // but one array_diff is not enough! + if (sizeof(array_diff($one, $two)) || sizeof(array_diff($two, $one))) + { + // get a nice error message + $this->assertEquals($one, $two); + } + else + { + // increase assertion count + $this->assertTrue(true); + } } } -- cgit v1.2.1 From 195014867ae84fe04ec01c913e38bf1d435590f7 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Sat, 10 Nov 2012 11:25:22 +0100 Subject: [ticket/11183] Remove $load_extensions and weird dl() calls PHPBB3-11183 --- tests/test_framework/phpbb_functional_test_case.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index d002615e8c..2d44bfc359 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -199,7 +199,7 @@ class phpbb_functional_test_case extends phpbb_test_case $this->do_request('create_table', $data); $this->do_request('config_file', $data); - file_put_contents($phpbb_root_path . "config.$phpEx", phpbb_create_config_file_data($data, self::$config['dbms'], array(), true, true)); + file_put_contents($phpbb_root_path . "config.$phpEx", phpbb_create_config_file_data($data, self::$config['dbms'], true, true)); $this->do_request('final', $data); copy($phpbb_root_path . "config.$phpEx", $phpbb_root_path . "config_test.$phpEx"); -- cgit v1.2.1