Skip to content
Snippets Groups Projects
Commit 54a3bdf1 authored by Thomas Müller's avatar Thomas Müller
Browse files

fixing unit test execution related to trashbin

parent 268d346b
Branches
No related tags found
No related merge requests found
......@@ -84,7 +84,7 @@ class Storage extends Wrapper {
* @param string $path
*/
public function unlink($path) {
if (self::$disableTrash) {
if (self::$disableTrash || !\OC_App::isEnabled('files_trashbin')) {
return $this->storage->unlink($path);
}
$normalized = Filesystem::normalizePath($this->mountPoint . '/' . $path);
......
......@@ -10,7 +10,9 @@
use OC\Avatar;
class Test_Avatar extends \Test\TestCase {
private static $trashBinStatus;
/** @var @var string */
private $user;
protected function setUp() {
......@@ -21,6 +23,17 @@ class Test_Avatar extends \Test\TestCase {
\OC\Files\Filesystem::mount($storage, array(), '/' . $this->user . '/');
}
public static function setUpBeforeClass() {
self::$trashBinStatus = \OC_App::isEnabled('files_trashbin');
\OC_App::disable('files_trashbin');
}
public static function tearDownAfterClass() {
if (self::$trashBinStatus) {
\OC_App::enable('files_trashbin');
}
}
public function testAvatar() {
$avatar = new Avatar($this->user);
......
......@@ -21,6 +21,20 @@
*/
class Test_StreamWrappers extends \Test\TestCase {
private static $trashBinStatus;
public static function setUpBeforeClass() {
self::$trashBinStatus = \OC_App::isEnabled('files_trashbin');
\OC_App::disable('files_trashbin');
}
public static function tearDownAfterClass() {
if (self::$trashBinStatus) {
\OC_App::enable('files_trashbin');
}
}
public function testFakeDir() {
$items = array('foo', 'bar');
\OC\Files\Stream\Dir::register('test', $items);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment