Beispiel #1
0
 public function test_folders()
 {
     $url = new Url('http://example.com');
     $this->assertSame($url->getFolders(), [], 'The root should have no folders');
     $url->path = '/test.html';
     $this->assertSame($url->getFolders(), [], 'a file in the root should have no folders');
     $url->path = '/folder1/';
     $this->assertSame($url->getFolders(), array('folder1'));
     $url->path = '/folder1/test.html';
     $this->assertSame($url->getFolders(), array('folder1'));
     $url->path = '/folder1/folder2/';
     $this->assertSame($url->getFolders(), array('folder1', 'folder2'));
     $url->path = '/folder1/folder2/test.html';
     $this->assertSame($url->getFolders(), array('folder1', 'folder2'));
 }