Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1841918
SplitTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Size
1 KB
Subscribers
None
SplitTest.php
View Options
<?php
namespace
Sabre\Uri
;
class
SplitTest
extends
\PHPUnit_Framework_TestCase
{
function
testSplit
()
{
$strings
=
[
// input // expected result
'/foo/bar'
=>
[
'/foo'
,
'bar'
],
'/foo/bar/'
=>
[
'/foo'
,
'bar'
],
'foo/bar/'
=>
[
'foo'
,
'bar'
],
'foo/bar'
=>
[
'foo'
,
'bar'
],
'foo/bar/baz'
=>
[
'foo/bar'
,
'baz'
],
'foo/bar/baz/'
=>
[
'foo/bar'
,
'baz'
],
'foo'
=>
[
''
,
'foo'
],
'foo/'
=>
[
''
,
'foo'
],
'/foo/'
=>
[
''
,
'foo'
],
'/foo'
=>
[
''
,
'foo'
],
''
=>
[
null
,
null
],
// UTF-8
"/
\x
C3
\x
A0fo
\x
C3
\x
B3/bar"
=>
[
"/
\x
C3
\x
A0fo
\x
C3
\x
B3"
,
'bar'
],
"/
\x
C3
\x
A0foo/b
\x
C3
\x
BCr/"
=>
[
"/
\x
C3
\x
A0foo"
,
"b
\x
C3
\x
BCr"
],
"foo/
\x
C3
\x
A0
\x
C3
\x
BCr"
=>
[
"foo"
,
"
\x
C3
\x
A0
\x
C3
\x
BCr"
],
];
foreach
(
$strings
as
$input
=>
$expected
)
{
$output
=
split
(
$input
);
$this
->
assertEquals
(
$expected
,
$output
,
'The expected output for
\'
'
.
$input
.
'
\'
was incorrect'
);
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Jan 7, 8:35 PM (8 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
915629
Default Alt Text
SplitTest.php (1 KB)
Attached To
rDAVCAL DokuWiki DAVCal PlugIn
Event Timeline
Log In to Comment