helper.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /**
  3. * @author Björn Schießle <schiessle@owncloud.com>
  4. * @author Lukas Reschke <lukas@owncloud.com>
  5. * @author Morris Jobke <hey@morrisjobke.de>
  6. * @author Thomas Müller <thomas.mueller@tmit.eu>
  7. *
  8. * @copyright Copyright (c) 2015, ownCloud, Inc.
  9. * @license AGPL-3.0
  10. *
  11. * This code is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License, version 3,
  13. * as published by the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License, version 3,
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>
  22. *
  23. */
  24. use OCA\Files_sharing\Tests\TestCase;
  25. /**
  26. * ownCloud
  27. *
  28. * @author Bjoern Schiessle
  29. * @copyright 2014 Bjoern Schiessle <schiessle@owncloud.com>
  30. *
  31. * This library is free software; you can redistribute it and/or
  32. * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  33. * License as published by the Free Software Foundation; either
  34. * version 3 of the License, or any later version.
  35. *
  36. * This library is distributed in the hope that it will be useful,
  37. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  38. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  39. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  40. *
  41. * You should have received a copy of the GNU Affero General Public
  42. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  43. *
  44. */
  45. class Test_Files_Sharing_Helper extends TestCase {
  46. /**
  47. * test set and get share folder
  48. */
  49. function testSetGetShareFolder() {
  50. $this->assertSame('/', \OCA\Files_Sharing\Helper::getShareFolder());
  51. \OCA\Files_Sharing\Helper::setShareFolder('/Shared/Folder');
  52. $sharedFolder = \OCA\Files_Sharing\Helper::getShareFolder();
  53. $this->assertSame('/Shared/Folder', \OCA\Files_Sharing\Helper::getShareFolder());
  54. $this->assertTrue(\OC\Files\Filesystem::is_dir($sharedFolder));
  55. // cleanup
  56. \OC::$server->getConfig()->deleteSystemValue('share_folder');
  57. }
  58. }