CommonTest.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Bart Visscher <bartv@thisnet.nl>
  6. * @author Christopher Schäpers <kondou@ts.unde.re>
  7. * @author Felix Moeller <mail@felixmoeller.de>
  8. * @author Michael Gapczynski <GapczynskiM@gmail.com>
  9. * @author Morris Jobke <hey@morrisjobke.de>
  10. * @author Robin Appelman <robin@icewind.nl>
  11. * @author Thomas Müller <thomas.mueller@tmit.eu>
  12. *
  13. * @license AGPL-3.0
  14. *
  15. * This code is free software: you can redistribute it and/or modify
  16. * it under the terms of the GNU Affero General Public License, version 3,
  17. * as published by the Free Software Foundation.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU Affero General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU Affero General Public License, version 3,
  25. * along with this program. If not, see <http://www.gnu.org/licenses/>
  26. *
  27. */
  28. /**
  29. * test implementation for \OC\Files\Storage\Common with \OC\Files\Storage\Local
  30. */
  31. namespace OC\Files\Storage;
  32. class CommonTest extends \OC\Files\Storage\Common{
  33. /**
  34. * underlying local storage used for missing functions
  35. * @var \OC\Files\Storage\Local
  36. */
  37. private $storage;
  38. public function __construct($params) {
  39. $this->storage=new \OC\Files\Storage\Local($params);
  40. }
  41. public function getId(){
  42. return 'test::'.$this->storage->getId();
  43. }
  44. public function mkdir($path) {
  45. return $this->storage->mkdir($path);
  46. }
  47. public function rmdir($path) {
  48. return $this->storage->rmdir($path);
  49. }
  50. public function opendir($path) {
  51. return $this->storage->opendir($path);
  52. }
  53. public function stat($path) {
  54. return $this->storage->stat($path);
  55. }
  56. public function filetype($path) {
  57. return @$this->storage->filetype($path);
  58. }
  59. public function isReadable($path) {
  60. return $this->storage->isReadable($path);
  61. }
  62. public function isUpdatable($path) {
  63. return $this->storage->isUpdatable($path);
  64. }
  65. public function file_exists($path) {
  66. return $this->storage->file_exists($path);
  67. }
  68. public function unlink($path) {
  69. return $this->storage->unlink($path);
  70. }
  71. public function fopen($path, $mode) {
  72. return $this->storage->fopen($path, $mode);
  73. }
  74. public function free_space($path) {
  75. return $this->storage->free_space($path);
  76. }
  77. public function touch($path, $mtime=null) {
  78. return $this->storage->touch($path, $mtime);
  79. }
  80. }