From aaaa4f9abe8665946b79cc55bf3a4d7e0133b6c9 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 19 May 2010 16:56:45 +0200 Subject: [PATCH] [ticket/9626] Adding tests for the URL regular expression. PHPBB3-9626 --- tests/regex/all_tests.php | 2 ++ tests/regex/url.php | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tests/regex/url.php diff --git a/tests/regex/all_tests.php b/tests/regex/all_tests.php index f2a23a0f98..316a9d4a58 100644 --- a/tests/regex/all_tests.php +++ b/tests/regex/all_tests.php @@ -18,6 +18,7 @@ require_once 'PHPUnit/TextUI/TestRunner.php'; require_once 'regex/email.php'; require_once 'regex/ipv4.php'; require_once 'regex/ipv6.php'; +require_once 'regex/url.php'; class phpbb_regex_all_tests { @@ -33,6 +34,7 @@ class phpbb_regex_all_tests $suite->addTestSuite('phpbb_regex_email_test'); $suite->addTestSuite('phpbb_regex_ipv4_test'); $suite->addTestSuite('phpbb_regex_ipv6_test'); + $suite->addTestSuite('phpbb_regex_url_test'); return $suite; } diff --git a/tests/regex/url.php b/tests/regex/url.php new file mode 100644 index 0000000000..678b7d108f --- /dev/null +++ b/tests/regex/url.php @@ -0,0 +1,34 @@ +assertEquals($expected, preg_match('#^' . get_preg_expression('url') . '$#i', $url)); + } +}