use Sabre\DAV\PropPatch;
use Sabre\DAV\Tree;
use Sabre\DAV\Exception\NotFound;
+use Sabre\DAV\Exception\ServiceUnavailable;
class CustomPropertiesBackend implements BackendInterface {
if (!($node instanceof Node)) {
return;
}
+ } catch (ServiceUnavailable $e) {
+ // might happen for unavailable mount points, skip
+ return;
} catch (NotFound $e) {
// in some rare (buggy) cases the node might not be found,
// we catch the exception to prevent breaking the whole list with a 404
* Test that propFind on a missing file soft fails
*/
public function testPropFindMissingFileSoftFail() {
- $this->tree->expects($this->any())
+ $this->tree->expects($this->at(0))
->method('getNodeForPath')
->with('/dummypath')
->will($this->throwException(new \Sabre\DAV\Exception\NotFound()));
+ $this->tree->expects($this->at(1))
+ ->method('getNodeForPath')
+ ->with('/dummypath')
+ ->will($this->throwException(new \Sabre\DAV\Exception\ServiceUnavailable()));
+
$propFind = new \Sabre\DAV\PropFind(
'/dummypath',
array(
$propFind
);
+ $this->plugin->propFind(
+ '/dummypath',
+ $propFind
+ );
+
// no exception, soft fail
$this->assertTrue(true);
}