ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
SplitTest.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
Sabre\Uri
;
4
5
class
SplitTest
extends
\PHPUnit_Framework_TestCase
{
6
7
function
testSplit
() {
8
9
$strings = [
10
11
// input // expected result
12
'/foo/bar'
=> [
'/foo'
,
'bar'
],
13
'/foo/bar/'
=> [
'/foo'
,
'bar'
],
14
'foo/bar/'
=> [
'foo'
,
'bar'
],
15
'foo/bar'
=> [
'foo'
,
'bar'
],
16
'foo/bar/baz'
=> [
'foo/bar'
,
'baz'
],
17
'foo/bar/baz/'
=> [
'foo/bar'
,
'baz'
],
18
'foo'
=> [
''
,
'foo'
],
19
'foo/'
=> [
''
,
'foo'
],
20
'/foo/'
=> [
''
,
'foo'
],
21
'/foo'
=> [
''
,
'foo'
],
22
''
=> [null,null],
23
24
// UTF-8
25
"/\xC3\xA0fo\xC3\xB3/bar"
=> [
"/\xC3\xA0fo\xC3\xB3"
,
'bar'
],
26
"/\xC3\xA0foo/b\xC3\xBCr/"
=> [
"/\xC3\xA0foo"
,
"b\xC3\xBCr"
],
27
"foo/\xC3\xA0\xC3\xBCr"
=> [
"foo"
,
"\xC3\xA0\xC3\xBCr"
],
28
29
];
30
31
foreach
($strings as
$input
=> $expected) {
32
33
$output
=
split
(
$input
);
34
$this->assertEquals($expected,
$output
,
'The expected output for \''
.
$input
.
'\'
was incorrect
');
35
36
37
}
38
39
}
40
41
}
$input
$input
Definition:
bench_manipulatevcard.php:18
Sabre\VObject\$output
$output
Definition:
mergeduplicates.php:36
Sabre\Uri\split
split($path)
Returns the 'dirname' and 'basename' for a path.
Definition:
functions.php:279
Sabre\Uri\SplitTest
Definition:
SplitTest.php:5
PHPUnit_Framework_TestCase
Sabre\Uri
Definition:
functions.php:3
Sabre\Uri\SplitTest\testSplit
testSplit()
Definition:
SplitTest.php:7
php
libs
composer
vendor
sabre
uri
tests
SplitTest.php
Generated on Thu Jan 16 2025 19:01:53 for ILIAS by
1.8.13 (using
Doxyfile
)