CommonTest.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OC\Files\Storage;
  8. class CommonTest extends \OC\Files\Storage\Common {
  9. /**
  10. * underlying local storage used for missing functions
  11. * @var \OC\Files\Storage\Local
  12. */
  13. private $storage;
  14. public function __construct($params) {
  15. $this->storage = new \OC\Files\Storage\Local($params);
  16. }
  17. public function getId() {
  18. return 'test::'.$this->storage->getId();
  19. }
  20. public function mkdir($path) {
  21. return $this->storage->mkdir($path);
  22. }
  23. public function rmdir($path) {
  24. return $this->storage->rmdir($path);
  25. }
  26. public function opendir($path) {
  27. return $this->storage->opendir($path);
  28. }
  29. public function stat($path) {
  30. return $this->storage->stat($path);
  31. }
  32. public function filetype($path) {
  33. return @$this->storage->filetype($path);
  34. }
  35. public function isReadable($path) {
  36. return $this->storage->isReadable($path);
  37. }
  38. public function isUpdatable($path) {
  39. return $this->storage->isUpdatable($path);
  40. }
  41. public function file_exists($path) {
  42. return $this->storage->file_exists($path);
  43. }
  44. public function unlink($path) {
  45. return $this->storage->unlink($path);
  46. }
  47. public function fopen($path, $mode) {
  48. return $this->storage->fopen($path, $mode);
  49. }
  50. public function free_space($path) {
  51. return $this->storage->free_space($path);
  52. }
  53. public function touch($path, $mtime = null) {
  54. return $this->storage->touch($path, $mtime);
  55. }
  56. }