assertEquals( $fakePath, $factory->parseUriToPath( $uri ) ); } public function testPathDispatchingWithBasePath() { $uri = '/my/webdav/base/collection/ressource'; $fakePath = '/collection/ressource'; $factory = new ezcWebdavBasicPathFactory( 'http://example.com/my/webdav/base' ); $this->assertEquals( $fakePath, $factory->parseUriToPath( $uri ) ); } public function testPathDispatchingCollectionWithoutBasePath() { $uri = '/collection/another_coll/'; $fakePath = '/collection/another_coll'; $factory = new ezcWebdavBasicPathFactory( 'http://example.com' ); $this->assertEquals( $fakePath, $factory->parseUriToPath( $uri ) ); } public function testPathDispatchingCollectionWithBasePath() { $uri = '/my/webdav/base/collection/another_coll'; $fakePath = '/collection/another_coll'; $factory = new ezcWebdavBasicPathFactory( 'http://example.com/my/webdav/base' ); $this->assertEquals( $fakePath, $factory->parseUriToPath( $uri ) ); } public function testUriDispatchingWithoutBasePath() { $uri = 'http://example.com/collection/ressource'; $fakePath = '/collection/ressource'; $factory = new ezcWebdavBasicPathFactory( 'http://example.com' ); $this->assertEquals( $fakePath, $factory->parseUriToPath( $uri ) ); } public function testUriDispatchingWithBasePath() { $uri = 'http://example.com/my/webdav/base/collection/ressource'; $fakePath = '/collection/ressource'; $factory = new ezcWebdavBasicPathFactory( 'http://example.com/my/webdav/base' ); $this->assertEquals( $fakePath, $factory->parseUriToPath( $uri ) ); } public function testUriDispatchingCollectionWithoutBasePath() { $uri = 'http://example.com/collection/another_coll/'; $fakePath = '/collection/another_coll'; $factory = new ezcWebdavBasicPathFactory( 'http://example.com' ); $this->assertEquals( $fakePath, $factory->parseUriToPath( $uri ) ); } public function testUriDispatchingCollectionWithBasePath() { $uri = 'http://example.com/my/webdav/base/collection/another_coll'; $fakePath = '/collection/another_coll'; $factory = new ezcWebdavBasicPathFactory( 'http://example.com/my/webdav/base' ); $this->assertEquals( $fakePath, $factory->parseUriToPath( $uri ) ); } public function testUriDispatchingCollectionWithoutBasePathRestore() { $uri = 'http://example.com/collection/another_coll/'; $fakePath = '/collection/another_coll'; $fakeUri = $uri; $factory = new ezcWebdavBasicPathFactory( 'http://example.com' ); $this->assertEquals( $fakePath, $factory->parseUriToPath( $uri ), 'Parsing of URI failed.' ); $this->assertEquals( $fakeUri, $factory->generateUriFromPath( $fakePath ), 'Restoring of URI failed' ); } public function testUriDispatchingCollectionWithBaseUriRestore() { $uri = 'http://example.com/my/webdav/base/collection/another_coll/'; $fakePath = '/collection/another_coll'; $fakeUri = $uri; $factory = new ezcWebdavBasicPathFactory( 'http://example.com/my/webdav/base' ); $this->assertEquals( $fakePath, $factory->parseUriToPath( $uri ), 'Parsing of URI failed.' ); $this->assertEquals( $fakeUri, $factory->generateUriFromPath( $fakePath ), 'Restoring of URI failed' ); } } ?>