From 01fe91c5c4e897801f5c179cd4060e686762f105 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Mon, 10 Jan 2011 00:18:37 +0100 Subject: [ticket/9987] Rename test files to include a _test suffix PHPBB3-9987 --- tests/regex/censor_test.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tests/regex/censor_test.php (limited to 'tests/regex/censor_test.php') diff --git a/tests/regex/censor_test.php b/tests/regex/censor_test.php new file mode 100644 index 0000000000..ae2d86e07e --- /dev/null +++ b/tests/regex/censor_test.php @@ -0,0 +1,40 @@ +assertRegExp($regex, $subject); + } +} \ No newline at end of file -- cgit v1.2.1 From 97be6e794647d0853274c5d8e68a9fbe727dba51 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 16 Jan 2011 20:03:08 +0100 Subject: [ticket/9933] Add $use_unicode parameter to get_censor_preg_expression(). Rename $unicode to $unicode_support, pass in $use_unicode defaulting to true. In unit tests we can now pass in $use_unicode as false and also test the code path that is taken when PCRE does not support unicode. PHPBB3-9933 --- tests/regex/censor_test.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'tests/regex/censor_test.php') diff --git a/tests/regex/censor_test.php b/tests/regex/censor_test.php index ae2d86e07e..93c761c8d0 100644 --- a/tests/regex/censor_test.php +++ b/tests/regex/censor_test.php @@ -31,9 +31,19 @@ class phpbb_regex_censor_test extends phpbb_test_case /** * @dataProvider censor_test_data */ - public function test_censor($pattern, $subject) + public function test_censor_unicode($pattern, $subject) { - $regex = get_censor_preg_expression($pattern); + $regex = get_censor_preg_expression($pattern, true); + + $this->assertRegExp($regex, $subject); + } + + /** + * @dataProvider censor_test_data + */ + public function test_censor_no_unicode($pattern, $subject) + { + $regex = get_censor_preg_expression($pattern, false); $this->assertRegExp($regex, $subject); } -- cgit v1.2.1 From 14891cdf4ecf0e3ee164962be6685b8563f37a15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Fr=C3=A8rejean?= Date: Mon, 31 Jan 2011 12:58:18 +0100 Subject: [ticket/10011] Tests don't work on PHP < 5.3 Due to the usage of `__DIR__` for the file includes the tests can't be ran on systems with PHP < 5.3. Replace all occurances of `__DIR__` with `dirname(__FILE__)`. PHPBB3-10011 --- tests/regex/censor_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/regex/censor_test.php') diff --git a/tests/regex/censor_test.php b/tests/regex/censor_test.php index 93c761c8d0..fa9104e71d 100644 --- a/tests/regex/censor_test.php +++ b/tests/regex/censor_test.php @@ -7,7 +7,7 @@ * */ -require_once __DIR__ . '/../../phpBB/includes/functions.php'; +require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; class phpbb_regex_censor_test extends phpbb_test_case { -- cgit v1.2.1 From 17991823ea72ef973852fd9d0a9c516703f2137e Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 31 Dec 2011 16:05:02 +0000 Subject: [ticket/9916] Updating License in the header PHPBB3-9916 --- tests/regex/censor_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/regex/censor_test.php') diff --git a/tests/regex/censor_test.php b/tests/regex/censor_test.php index fa9104e71d..5929092e07 100644 --- a/tests/regex/censor_test.php +++ b/tests/regex/censor_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ -- cgit v1.2.1