]> source.dussan.org Git - nextcloud-server.git/commitdiff
fixing unit test execution related to trashbin
authorThomas Müller <thomas.mueller@tmit.eu>
Tue, 7 Apr 2015 10:46:07 +0000 (12:46 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Tue, 7 Apr 2015 11:30:31 +0000 (13:30 +0200)
apps/files_trashbin/lib/storage.php
tests/lib/avatar.php
tests/lib/streamwrappers.php

index df80649a50ba4bc7a86c0599567e7e079f72e1a7..61e0816fd248b0159f56c37ac1809f04aee9d1d0 100644 (file)
@@ -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);
index e852a7fc6ff73f4a72db1b3f6720cfa1a86d26fd..9e1f367108da960400b5f19ebd51adfc27be4b97 100644 (file)
@@ -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);
index 2a8c8676c16a04a2126621da15f7abfb7d1c28a9..fc3d02acae7218e1b65e2273c71c2cdccfdcabad 100644 (file)
  */
 
 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);