HelperTest.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Björn Schießle <bjoern@schiessle.org>
  6. * @author Joas Schilling <coding@schilljs.com>
  7. * @author Morris Jobke <hey@morrisjobke.de>
  8. * @author Roeland Jago Douma <roeland@famdouma.nl>
  9. * @author Thomas Müller <thomas.mueller@tmit.eu>
  10. *
  11. * @license AGPL-3.0
  12. *
  13. * This code is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License, version 3,
  15. * as published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License, version 3,
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>
  24. *
  25. */
  26. namespace OCA\Files_Sharing\Tests;
  27. /**
  28. * Class HelperTest
  29. *
  30. * @group DB
  31. */
  32. class HelperTest extends TestCase {
  33. /**
  34. * test set and get share folder
  35. */
  36. public function testSetGetShareFolder() {
  37. $this->assertSame('/', \OCA\Files_Sharing\Helper::getShareFolder());
  38. \OCA\Files_Sharing\Helper::setShareFolder('/Shared/Folder');
  39. $sharedFolder = \OCA\Files_Sharing\Helper::getShareFolder();
  40. $this->assertSame('/Shared/Folder', \OCA\Files_Sharing\Helper::getShareFolder());
  41. $this->assertTrue(\OC\Files\Filesystem::is_dir($sharedFolder));
  42. // cleanup
  43. \OC::$server->getConfig()->deleteSystemValue('share_folder');
  44. }
  45. }