WrapperTest.php 963 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace Test\Files\Storage\Wrapper;
  8. class WrapperTest extends \Test\Files\Storage\Storage {
  9. /**
  10. * @var string tmpDir
  11. */
  12. private $tmpDir;
  13. protected function setUp(): void {
  14. parent::setUp();
  15. $this->tmpDir = \OC::$server->getTempManager()->getTemporaryFolder();
  16. $storage = new \OC\Files\Storage\Local(['datadir' => $this->tmpDir]);
  17. $this->instance = new \OC\Files\Storage\Wrapper\Wrapper(['storage' => $storage]);
  18. }
  19. protected function tearDown(): void {
  20. \OC_Helper::rmdirr($this->tmpDir);
  21. parent::tearDown();
  22. }
  23. public function testInstanceOfStorageWrapper(): void {
  24. $this->assertTrue($this->instance->instanceOfStorage('\OC\Files\Storage\Local'));
  25. $this->assertTrue($this->instance->instanceOfStorage('\OC\Files\Storage\Wrapper\Wrapper'));
  26. }
  27. }