Also clean up the share if cleaning up fails

This commit is contained in:
Robin Appelman 2014-11-14 16:52:44 +01:00
commit 80d5918640

View file

@ -28,10 +28,15 @@ abstract class AbstractShare extends \PHPUnit_Framework_TestCase {
protected $config; protected $config;
public function tearDown() { public function tearDown() {
if ($this->share) { try {
$this->cleanDir($this->root); if ($this->share) {
$this->cleanDir($this->root);
}
unset($this->share);
} catch (\Exception $e) {
unset($this->share);
throw $e;
} }
unset($this->share);
} }
public function nameProvider() { public function nameProvider() {
@ -474,8 +479,10 @@ abstract class AbstractShare extends \PHPUnit_Framework_TestCase {
array('bar.txt'), array('bar.txt'),
array("single'quote'/sub/foo.txt"), array("single'quote'/sub/foo.txt"),
array('日本語/url %2F +encode/asd.txt'), array('日本語/url %2F +encode/asd.txt'),
array('a somewhat longer folder than the other with more charaters as the all the other filenames/' . array(
'followed by a somewhat long file name after that.txt') 'a somewhat longer folder than the other with more charaters as the all the other filenames/' .
'followed by a somewhat long file name after that.txt'
)
); );
} }