ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\Uri\SplitTest Class Reference
+ Inheritance diagram for Sabre\Uri\SplitTest:
+ Collaboration diagram for Sabre\Uri\SplitTest:

Public Member Functions

 testSplit ()
 

Detailed Description

Definition at line 5 of file SplitTest.php.

Member Function Documentation

◆ testSplit()

Sabre\Uri\SplitTest::testSplit ( )

Definition at line 7 of file SplitTest.php.

References $input, Sabre\VObject\$output, and Sabre\Uri\split().

7  {
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  }
split($path)
Returns the 'dirname' and 'basename' for a path.
Definition: functions.php:279
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: