From face175471b5064117ca57ece53a3403e51e20ba Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Sun, 13 Apr 2014 21:15:14 +0200 Subject: [ticket/10423] Move code into a function and add tests for it PHPBB3-10423 --- .../phpbb_clean_search_string_test.php | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/functions_content/phpbb_clean_search_string_test.php (limited to 'tests/functions_content') diff --git a/tests/functions_content/phpbb_clean_search_string_test.php b/tests/functions_content/phpbb_clean_search_string_test.php new file mode 100644 index 0000000000..3706ffedf9 --- /dev/null +++ b/tests/functions_content/phpbb_clean_search_string_test.php @@ -0,0 +1,37 @@ +assertEquals($expected, phpbb_clean_search_string($search_string)); + } +} -- cgit v1.2.1 From dde7ac3b2bcee9832a12255a8df496a67743e2e0 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Sun, 13 Apr 2014 21:31:44 +0200 Subject: [ticket/10423] Match multiple wildcards Multiple wildcards are removed from the string if there is no word before or after them. If there is a word before or after them, they are just replaced with a single one. PHPBB3-10423 --- tests/functions_content/phpbb_clean_search_string_test.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/functions_content') diff --git a/tests/functions_content/phpbb_clean_search_string_test.php b/tests/functions_content/phpbb_clean_search_string_test.php index 3706ffedf9..fef9b5e9ea 100644 --- a/tests/functions_content/phpbb_clean_search_string_test.php +++ b/tests/functions_content/phpbb_clean_search_string_test.php @@ -24,6 +24,8 @@ class phpbb_functions_content_phpbb_clean_search_string_test extends phpbb_test_ array('* *test*', '*test*'), array('test test * test', 'test test test'), array(' some wild*cards * between wo*rds ', 'some wild*cards between wo*rds'), + array(' we * now have*** multiple wild***cards * ', 'we now have* multiple wild*cards'), + array('pi is *** . * **** * *****', 'pi is .'), ); } -- cgit v1.2.1 From 601ecd3da132c376be2119ef7bc7126f219859f3 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Mon, 14 Apr 2014 18:31:30 +0200 Subject: [ticket/10423] Remove unnecessary include in test PHPBB3-10423 --- tests/functions_content/phpbb_clean_search_string_test.php | 1 - 1 file changed, 1 deletion(-) (limited to 'tests/functions_content') diff --git a/tests/functions_content/phpbb_clean_search_string_test.php b/tests/functions_content/phpbb_clean_search_string_test.php index fef9b5e9ea..de642c9040 100644 --- a/tests/functions_content/phpbb_clean_search_string_test.php +++ b/tests/functions_content/phpbb_clean_search_string_test.php @@ -7,7 +7,6 @@ * */ -require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php'; class phpbb_functions_content_phpbb_clean_search_string_test extends phpbb_test_case -- cgit v1.2.1