HelperTest.php 824 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OCA\Files_Sharing\Tests;
  8. /**
  9. * Class HelperTest
  10. *
  11. * @group DB
  12. */
  13. class HelperTest extends TestCase {
  14. /**
  15. * test set and get share folder
  16. */
  17. public function testSetGetShareFolder(): void {
  18. $this->assertSame('/', \OCA\Files_Sharing\Helper::getShareFolder());
  19. \OCA\Files_Sharing\Helper::setShareFolder('/Shared/Folder');
  20. $sharedFolder = \OCA\Files_Sharing\Helper::getShareFolder();
  21. $this->assertSame('/Shared/Folder', \OCA\Files_Sharing\Helper::getShareFolder());
  22. $this->assertTrue(\OC\Files\Filesystem::is_dir($sharedFolder));
  23. // cleanup
  24. \OC::$server->getConfig()->deleteSystemValue('share_folder');
  25. }
  26. }