HelperTest.php 794 B

12345678910111213141516171819202122232425262728293031323334
  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. use OC\Files\Filesystem;
  9. use OCA\Files_Sharing\Helper;
  10. /**
  11. * Class HelperTest
  12. *
  13. * @group DB
  14. */
  15. class HelperTest extends TestCase {
  16. /**
  17. * test set and get share folder
  18. */
  19. public function testSetGetShareFolder(): void {
  20. $this->assertSame('/', Helper::getShareFolder());
  21. Helper::setShareFolder('/Shared/Folder');
  22. $sharedFolder = Helper::getShareFolder();
  23. $this->assertSame('/Shared/Folder', Helper::getShareFolder());
  24. $this->assertTrue(Filesystem::is_dir($sharedFolder));
  25. // cleanup
  26. \OC::$server->getConfig()->deleteSystemValue('share_folder');
  27. }
  28. }