diff options
Diffstat (limited to 'tests/lib/files/cache')
-rw-r--r-- | tests/lib/files/cache/cache.php | 10 | ||||
-rw-r--r-- | tests/lib/files/cache/changepropagator.php | 8 | ||||
-rw-r--r-- | tests/lib/files/cache/homecache.php | 6 | ||||
-rw-r--r-- | tests/lib/files/cache/scanner.php | 10 | ||||
-rw-r--r-- | tests/lib/files/cache/updater.php | 3 | ||||
-rw-r--r-- | tests/lib/files/cache/updaterlegacy.php | 9 | ||||
-rw-r--r-- | tests/lib/files/cache/watcher.php | 2 |
7 files changed, 32 insertions, 16 deletions
diff --git a/tests/lib/files/cache/cache.php b/tests/lib/files/cache/cache.php index 969740419c6..02c45a16571 100644 --- a/tests/lib/files/cache/cache.php +++ b/tests/lib/files/cache/cache.php @@ -16,7 +16,7 @@ class LongId extends \OC\Files\Storage\Temporary { } } -class Cache extends \PHPUnit_Framework_TestCase { +class Cache extends \Test\TestCase { /** * @var \OC\Files\Storage\Temporary $storage ; */ @@ -452,13 +452,17 @@ class Cache extends \PHPUnit_Framework_TestCase { $this->assertEquals(1, count($this->cache->getFolderContents('folder'))); } - public function tearDown() { + protected function tearDown() { if ($this->cache) { $this->cache->clear(); } + + parent::tearDown(); } - public function setUp() { + protected function setUp() { + parent::setUp(); + $this->storage = new \OC\Files\Storage\Temporary(array()); $this->storage2 = new \OC\Files\Storage\Temporary(array()); $this->cache = new \OC\Files\Cache\Cache($this->storage); diff --git a/tests/lib/files/cache/changepropagator.php b/tests/lib/files/cache/changepropagator.php index a52682cd086..89bd9dfe80a 100644 --- a/tests/lib/files/cache/changepropagator.php +++ b/tests/lib/files/cache/changepropagator.php @@ -12,7 +12,7 @@ use OC\Files\Filesystem; use OC\Files\Storage\Temporary; use OC\Files\View; -class ChangePropagator extends \PHPUnit_Framework_TestCase { +class ChangePropagator extends \Test\TestCase { /** * @var \OC\Files\Cache\ChangePropagator */ @@ -23,9 +23,11 @@ class ChangePropagator extends \PHPUnit_Framework_TestCase { */ private $view; - public function setUp() { + protected function setUp() { + parent::setUp(); + $storage = new Temporary(array()); - $root = '/' . uniqid(); + $root = $this->getUniqueID('/'); Filesystem::mount($storage, array(), $root); $this->view = new View($root); $this->propagator = new \OC\Files\Cache\ChangePropagator($this->view); diff --git a/tests/lib/files/cache/homecache.php b/tests/lib/files/cache/homecache.php index 80dc54c9d19..7ebb053bcfa 100644 --- a/tests/lib/files/cache/homecache.php +++ b/tests/lib/files/cache/homecache.php @@ -43,7 +43,7 @@ class DummyUser extends \OC\User\User { } } -class HomeCache extends \PHPUnit_Framework_TestCase { +class HomeCache extends \Test\TestCase { /** * @var \OC\Files\Storage\Home $storage */ @@ -59,7 +59,9 @@ class HomeCache extends \PHPUnit_Framework_TestCase { */ private $user; - public function setUp() { + protected function setUp() { + parent::setUp(); + $this->user = new DummyUser('foo', \OC_Helper::tmpFolder()); $this->storage = new \OC\Files\Storage\Home(array('user' => $this->user)); $this->cache = $this->storage->getCache(); diff --git a/tests/lib/files/cache/scanner.php b/tests/lib/files/cache/scanner.php index 0a274631d1c..b44cf0a49df 100644 --- a/tests/lib/files/cache/scanner.php +++ b/tests/lib/files/cache/scanner.php @@ -8,7 +8,7 @@ namespace Test\Files\Cache; -class Scanner extends \PHPUnit_Framework_TestCase { +class Scanner extends \Test\TestCase { /** * @var \OC\Files\Storage\Storage $storage */ @@ -24,16 +24,20 @@ class Scanner extends \PHPUnit_Framework_TestCase { */ private $cache; - function setUp() { + protected function setUp() { + parent::setUp(); + $this->storage = new \OC\Files\Storage\Temporary(array()); $this->scanner = new \OC\Files\Cache\Scanner($this->storage); $this->cache = new \OC\Files\Cache\Cache($this->storage); } - function tearDown() { + protected function tearDown() { if ($this->cache) { $this->cache->clear(); } + + parent::tearDown(); } function testFile() { diff --git a/tests/lib/files/cache/updater.php b/tests/lib/files/cache/updater.php index 9e7330db20c..01b036de5d8 100644 --- a/tests/lib/files/cache/updater.php +++ b/tests/lib/files/cache/updater.php @@ -12,7 +12,7 @@ use OC\Files\Filesystem; use OC\Files\Storage\Temporary; use OC\Files\View; -class Updater extends \PHPUnit_Framework_TestCase { +class Updater extends \Test\TestCase { /** * @var \OC\Files\Storage\Storage */ @@ -40,6 +40,7 @@ class Updater extends \PHPUnit_Framework_TestCase { parent::setUp(); $this->originalStorage = Filesystem::getStorage('/'); + $this->storage = new Temporary(array()); Filesystem::clearMounts(); Filesystem::mount($this->storage, array(), '/'); diff --git a/tests/lib/files/cache/updaterlegacy.php b/tests/lib/files/cache/updaterlegacy.php index d16a062fcca..7c05800cd6b 100644 --- a/tests/lib/files/cache/updaterlegacy.php +++ b/tests/lib/files/cache/updaterlegacy.php @@ -11,7 +11,7 @@ namespace Test\Files\Cache; use \OC\Files\Filesystem as Filesystem; use OC\Files\Storage\Temporary; -class UpdaterLegacy extends \PHPUnit_Framework_TestCase { +class UpdaterLegacy extends \Test\TestCase { /** * @var \OC\Files\Storage\Storage $storage */ @@ -34,7 +34,8 @@ class UpdaterLegacy extends \PHPUnit_Framework_TestCase { private static $user; - public function setUp() { + protected function setUp() { + parent::setUp(); // remember files_encryption state $this->stateFilesEncryption = \OC_App::isEnabled('files_encryption'); @@ -71,7 +72,7 @@ class UpdaterLegacy extends \PHPUnit_Framework_TestCase { \OC_Hook::clear('OC_Filesystem'); } - public function tearDown() { + protected function tearDown() { if ($this->cache) { $this->cache->clear(); } @@ -83,6 +84,8 @@ class UpdaterLegacy extends \PHPUnit_Framework_TestCase { if ($this->stateFilesEncryption) { \OC_App::enable('files_encryption'); } + + parent::tearDown(); } public function testWrite() { diff --git a/tests/lib/files/cache/watcher.php b/tests/lib/files/cache/watcher.php index 0b04b9e7058..ee605c64e01 100644 --- a/tests/lib/files/cache/watcher.php +++ b/tests/lib/files/cache/watcher.php @@ -8,7 +8,7 @@ namespace Test\Files\Cache; -class Watcher extends \PHPUnit_Framework_TestCase { +class Watcher extends \Test\TestCase { /** * @var \OC\Files\Storage\Storage[] $storages |