diff options
author | Maat <maat-pub@mageia.biz> | 2012-06-03 21:23:14 +0200 |
---|---|---|
committer | Maat <maat-pub@mageia.biz> | 2012-06-03 21:23:14 +0200 |
commit | a06a38ae692551dc1c0416b835ce9924b3d9f7f5 (patch) | |
tree | 1bb2c2b3d8d56668585513890afc1d641cead0b1 /tests/regex/url_test.php | |
parent | 2db884ac2e5122be1db0582b76bf7204783a0c0d (diff) | |
parent | 19a47dfbbc4265e33c14d6679b5693d80120db4b (diff) | |
download | forums-a06a38ae692551dc1c0416b835ce9924b3d9f7f5.tar forums-a06a38ae692551dc1c0416b835ce9924b3d9f7f5.tar.gz forums-a06a38ae692551dc1c0416b835ce9924b3d9f7f5.tar.bz2 forums-a06a38ae692551dc1c0416b835ce9924b3d9f7f5.tar.xz forums-a06a38ae692551dc1c0416b835ce9924b3d9f7f5.zip |
Merging with upstream 3.0.11
Diffstat (limited to 'tests/regex/url_test.php')
-rw-r--r-- | tests/regex/url_test.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/regex/url_test.php b/tests/regex/url_test.php new file mode 100644 index 0000000000..b395f5cae2 --- /dev/null +++ b/tests/regex/url_test.php @@ -0,0 +1,33 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2010 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_url_test extends phpbb_test_case +{ + public function url_test_data() + { + return array( + array('http://www.phpbb.com/community/', 1), + array('http://www.phpbb.com/path/file.ext#section', 1), + array('ftp://ftp.phpbb.com/', 1), + array('sip://bantu@phpbb.com', 1), + + array('www.phpbb.com/community/', 0), + ); + } + + /** + * @dataProvider url_test_data + */ + public function test_url($url, $expected) + { + $this->assertEquals($expected, preg_match('#^' . get_preg_expression('url') . '$#i', $url)); + } +} |