diff options
author | Andreas Fischer <bantu@phpbb.com> | 2013-05-15 13:50:54 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2013-05-15 13:50:54 +0200 |
commit | f7fa95f6fa7593e1076e1b27bb4429da0300aa89 (patch) | |
tree | e3312e181a9c7224943f0757a8d8a79bac69f52d /tests/functions | |
parent | bcf7ea33106ba99aee20d672eda3d58c95251f11 (diff) | |
parent | f2bc62ba75648d9a56d8fa5f215e4bffd299e77a (diff) | |
download | forums-f7fa95f6fa7593e1076e1b27bb4429da0300aa89.tar forums-f7fa95f6fa7593e1076e1b27bb4429da0300aa89.tar.gz forums-f7fa95f6fa7593e1076e1b27bb4429da0300aa89.tar.bz2 forums-f7fa95f6fa7593e1076e1b27bb4429da0300aa89.tar.xz forums-f7fa95f6fa7593e1076e1b27bb4429da0300aa89.zip |
Merge branch 'develop-olympus' into develop
* develop-olympus:
[ticket/11540] Add unit tests for is_absolute()
Diffstat (limited to 'tests/functions')
-rw-r--r-- | tests/functions/is_absolute_test.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/functions/is_absolute_test.php b/tests/functions/is_absolute_test.php new file mode 100644 index 0000000000..26425d2a36 --- /dev/null +++ b/tests/functions/is_absolute_test.php @@ -0,0 +1,34 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2013 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_functions_is_absolute_test extends phpbb_test_case +{ + static public function is_absolute_data() + { + return array( + array('/etc/phpbb', true), + array('etc/phpbb', false), + + // Until we got DIRECTORY_SEPARATOR replaced in that function, + // test results vary on OS. + array('c:\windows', DIRECTORY_SEPARATOR == '\\'), + array('C:\Windows', DIRECTORY_SEPARATOR == '\\'), + ); + } + + /** + * @dataProvider is_absolute_data + */ + public function test_is_absolute($path, $expected) + { + $this->assertEquals($expected, is_absolute($path)); + } +} |