aboutsummaryrefslogtreecommitdiffstats
path: root/tests/regex
diff options
context:
space:
mode:
Diffstat (limited to 'tests/regex')
-rw-r--r--tests/regex/censor_test.php2
-rw-r--r--tests/regex/email_test.php2
-rw-r--r--tests/regex/ipv4_test.php2
-rw-r--r--tests/regex/ipv6_test.php2
-rw-r--r--tests/regex/password_complexity_test.php2
-rw-r--r--tests/regex/table_prefix_test.php35
-rw-r--r--tests/regex/url_test.php2
7 files changed, 41 insertions, 6 deletions
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
*
*/
diff --git a/tests/regex/email_test.php b/tests/regex/email_test.php
index 0695b801d5..17f93259c3 100644
--- a/tests/regex/email_test.php
+++ b/tests/regex/email_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
*
*/
diff --git a/tests/regex/ipv4_test.php b/tests/regex/ipv4_test.php
index 9829547508..38a3aa4a8e 100644
--- a/tests/regex/ipv4_test.php
+++ b/tests/regex/ipv4_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
*
*/
diff --git a/tests/regex/ipv6_test.php b/tests/regex/ipv6_test.php
index 1b2018403c..d24217b346 100644
--- a/tests/regex/ipv6_test.php
+++ b/tests/regex/ipv6_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
*
*/
diff --git a/tests/regex/password_complexity_test.php b/tests/regex/password_complexity_test.php
index 21e8d12a0a..07453555ee 100644
--- a/tests/regex/password_complexity_test.php
+++ b/tests/regex/password_complexity_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
*
*/
diff --git a/tests/regex/table_prefix_test.php b/tests/regex/table_prefix_test.php
new file mode 100644
index 0000000000..33bdd4ae2d
--- /dev/null
+++ b/tests/regex/table_prefix_test.php
@@ -0,0 +1,35 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_regex_table_prefix_test extends phpbb_test_case
+{
+ public function table_prefix_test_data()
+ {
+ return array(
+ array('phpbb_', 1),
+ array('phpBB3', 1),
+ array('a', 1),
+
+ array('', 0),
+ array('_', 0),
+ array('a-', 0),
+ array("'", 0),
+ );
+ }
+
+ /**
+ * @dataProvider table_prefix_test_data
+ */
+ public function test_table_prefix($prefix, $expected)
+ {
+ $this->assertEquals($expected, preg_match(get_preg_expression('table_prefix'), $prefix));
+ }
+}
diff --git a/tests/regex/url_test.php b/tests/regex/url_test.php
index c3a336063a..b395f5cae2 100644
--- a/tests/regex/url_test.php
+++ b/tests/regex/url_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
*
*/