diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-06-08 20:46:00 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-06-08 20:46:00 +0200 |
commit | e769ef9bbb2db10e3c44a0a055189e45a58716be (patch) | |
tree | bb23d8e9ecad93b4d46efc30371b0ddadf26b5ad /tests/lib | |
parent | 1037533a9e3e3ad141c08dcfaef48abeb48ce8bf (diff) | |
parent | 6e2358c3a6b1417002b74275f1c34d738f35f1ba (diff) | |
download | nextcloud-server-e769ef9bbb2db10e3c44a0a055189e45a58716be.tar.gz nextcloud-server-e769ef9bbb2db10e3c44a0a055189e45a58716be.zip |
Merge pull request #8916 from owncloud/rmdirr-test-cleanup-fix
Added hacky fix for long path cleanup routine
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/files/view.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php index 8eca55d1fdf..a0f4d97d5b4 100644 --- a/tests/lib/files/view.php +++ b/tests/lib/files/view.php @@ -22,6 +22,8 @@ class View extends \PHPUnit_Framework_TestCase { private $storages = array(); private $user; + private $tempStorage; + public function setUp() { \OC_User::clearBackends(); \OC_User::useBackend(new \OC_User_Dummy()); @@ -32,6 +34,8 @@ class View extends \PHPUnit_Framework_TestCase { \OC_User::setUserId('test'); \OC\Files\Filesystem::clearMounts(); + + $this->tempStorage = null; } public function tearDown() { @@ -41,6 +45,10 @@ class View extends \PHPUnit_Framework_TestCase { $ids = $cache->getAll(); $cache->clear(); } + + if ($this->tempStorage && !\OC_Util::runningOnWindows()) { + system('rm -rf ' . escapeshellarg($this->tempStorage->getDataDir())); + } } /** @@ -665,6 +673,7 @@ class View extends \PHPUnit_Framework_TestCase { } $storage = new \OC\Files\Storage\Temporary(array()); + $this->tempStorage = $storage; // for later hard cleanup \OC\Files\Filesystem::mount($storage, array(), '/'); $rootView = new \OC\Files\View(''); @@ -679,10 +688,6 @@ class View extends \PHPUnit_Framework_TestCase { } call_user_func(array($rootView, $operation), $longPath, $param0); - - if (!\OC_Util::runningOnWindows()) { - system('rm -rf ' . escapeshellarg($storage->getDataDir())); - } } public function tooLongPathDataProvider() { |