diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-04-15 23:23:44 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-04-15 23:23:44 +0200 |
commit | d1f96aa03601536c6e191328183ac2dd0068aed7 (patch) | |
tree | e0a45c989dbd165a364e24874f6402979a0f47e1 /tests/functions_content | |
parent | c63b5275d858a3ec11674d20d1d2479e5c7477b5 (diff) | |
parent | 675cef9c2e9ea571606415fb3228b5f2c73769d9 (diff) | |
download | forums-d1f96aa03601536c6e191328183ac2dd0068aed7.tar forums-d1f96aa03601536c6e191328183ac2dd0068aed7.tar.gz forums-d1f96aa03601536c6e191328183ac2dd0068aed7.tar.bz2 forums-d1f96aa03601536c6e191328183ac2dd0068aed7.tar.xz forums-d1f96aa03601536c6e191328183ac2dd0068aed7.zip |
Merge branch 'develop-olympus' into develop-ascraeus
* develop-olympus:
[ticket/10423] Replace foreach with function in viewtopic.php
[ticket/10423] Remove unnecessary include in test
[ticket/10423] Match multiple wildcards
[ticket/10423] Move code into a function and add tests for it
[ticket/10423] Remove * from search or highlight string
Diffstat (limited to 'tests/functions_content')
-rw-r--r-- | tests/functions_content/phpbb_clean_search_string_test.php | 38 |
1 files changed, 38 insertions, 0 deletions
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..de642c9040 --- /dev/null +++ b/tests/functions_content/phpbb_clean_search_string_test.php @@ -0,0 +1,38 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2014 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php'; + +class phpbb_functions_content_phpbb_clean_search_string_test extends phpbb_test_case +{ + public function phpbb_clean_search_string_data() + { + return array( + array('*', ''), + array('* *', ''), + array('test', 'test'), + array(' test ', 'test'), + array(' test * ', 'test'), + array('test* *', '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 .'), + ); + } + + /** + * @dataProvider phpbb_clean_search_string_data + */ + public function test_phpbb_clean_search_string($search_string, $expected) + { + $this->assertEquals($expected, phpbb_clean_search_string($search_string)); + } +} |