diff options
author | Aleksander Machniak <alec@alec.pl> | 2014-11-16 14:04:53 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2014-11-16 14:04:53 +0100 |
commit | 9e4246d9571481fe7b80227b1e23dc013771c5af (patch) | |
tree | a051a22d8ecda4a648adcfe11504648f57f60e2a /tests | |
parent | 07280e764357fe844c18beb9ada772956735b49e (diff) |
Code improvements and fixes (mostly unused variables and methods)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Framework/BaseReplacer.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/Framework/BaseReplacer.php b/tests/Framework/BaseReplacer.php index 44a9604ac..2255e9af2 100644 --- a/tests/Framework/BaseReplacer.php +++ b/tests/Framework/BaseReplacer.php @@ -31,4 +31,32 @@ class Framework_BaseReplacer extends PHPUnit_Framework_TestCase $this->assertSame('<A href="http://shouldbethislink.com">Test URL</A>', $response); } + + /** + * Data for absolute_url() test + */ + function data_absolute_url() + { + return array( + array('', 'http://test', 'http://test/'), + array('http://test', 'http://anything', 'http://test'), + array('cid:test', 'http://anything', 'cid:test'), + array('/test', 'http://test', 'http://test/test'), + array('./test', 'http://test', 'http://test/test'), + array('../test1', 'http://test/test2', 'http://test1'), + array('../test1', 'http://test/test2/', 'http://test/test1'), + ); + } + + /** + * Test absolute_url() + * @dataProvider data_absolute_url + */ + function test_absolute_url($path, $base, $expected) + { + $replacer = new rcube_base_replacer('test'); + $result = $replacer->absolute_url($path, $base); + + $this->assertSame($expected, $result); + } } |