commontest.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. /**
  3. * ownCloud
  4. *
  5. * @author Robin Appelman
  6. * @copyright 2012 Robin Appelman icewind@owncloud.com
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  10. * License as published by the Free Software Foundation; either
  11. * version 3 of the License, or any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public
  19. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. /**
  23. * test implementation for \OC\Files\Storage\Common with \OC\Files\Storage\Local
  24. */
  25. namespace OC\Files\Storage;
  26. class CommonTest extends \OC\Files\Storage\Common{
  27. /**
  28. * underlying local storage used for missing functions
  29. * @var \OC\Files\Storage\Local
  30. */
  31. private $storage;
  32. public function __construct($params) {
  33. $this->storage=new \OC\Files\Storage\Local($params);
  34. }
  35. public function getId(){
  36. return 'test::'.$this->storage->getId();
  37. }
  38. public function mkdir($path) {
  39. return $this->storage->mkdir($path);
  40. }
  41. public function rmdir($path) {
  42. return $this->storage->rmdir($path);
  43. }
  44. public function opendir($path) {
  45. return $this->storage->opendir($path);
  46. }
  47. public function stat($path) {
  48. return $this->storage->stat($path);
  49. }
  50. public function filetype($path) {
  51. return @$this->storage->filetype($path);
  52. }
  53. public function isReadable($path) {
  54. return $this->storage->isReadable($path);
  55. }
  56. public function isUpdatable($path) {
  57. return $this->storage->isUpdatable($path);
  58. }
  59. public function file_exists($path) {
  60. return $this->storage->file_exists($path);
  61. }
  62. public function unlink($path) {
  63. return $this->storage->unlink($path);
  64. }
  65. public function fopen($path, $mode) {
  66. return $this->storage->fopen($path, $mode);
  67. }
  68. public function free_space($path) {
  69. return $this->storage->free_space($path);
  70. }
  71. public function touch($path, $mtime=null) {
  72. return $this->storage->touch($path, $mtime);
  73. }
  74. }