AppLocatorTest.php 916 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace Test\IntegrityCheck\Helpers;
  8. use OC\IntegrityCheck\Helpers\AppLocator;
  9. use Test\TestCase;
  10. class AppLocatorTest extends TestCase {
  11. /** @var AppLocator */
  12. private $locator;
  13. protected function setUp(): void {
  14. parent::setUp();
  15. $this->locator = new AppLocator();
  16. }
  17. public function testGetAppPath() {
  18. $this->assertSame(\OC_App::getAppPath('files'), $this->locator->getAppPath('files'));
  19. }
  20. public function testGetAppPathNotExistentApp() {
  21. $this->expectException(\Exception::class);
  22. $this->expectExceptionMessage('App not found');
  23. $this->locator->getAppPath('aTotallyNotExistingApp');
  24. }
  25. public function testGetAllApps() {
  26. $this->assertSame(\OC_App::getAllApps(), $this->locator->getAllApps());
  27. }
  28. }