diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml new file mode 100644 index 00000000..0f771b13 --- /dev/null +++ b/.github/workflows/lint-php-cs.yml @@ -0,0 +1,59 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + +name: Lint php-cs + +on: + push: + branches: [ main, test ] + paths: + - 'lib/**' + - 'templates/**' + - 'tests/**' + - 'vendor/**' + - 'vendor-bin/**' + - composer.lock + - composer.json + pull_request: + paths: + - 'lib/**' + - 'templates/**' + - 'tests/**' + - 'vendor/**' + - 'vendor-bin/**' + - composer.lock + - composer.json + +permissions: + contents: read + +concurrency: + group: lint-php-cs-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + + name: php-cs + + steps: + - name: Checkout + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + + - name: Set up php + uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2 + with: + php-version: 8.2 + coverage: none + ini-file: development + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Install dependencies + run: composer i + + - name: Lint + run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 501e2397..16e743dc 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -56,7 +56,6 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - tools: phpunit extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, gd, zip - name: Set up PHPUnit @@ -71,4 +70,4 @@ jobs: - name: PHPUnit working-directory: apps/${{ env.APP_NAME }} - run: phpunit -c tests/phpunit.xml + run: composer run test:unit diff --git a/.gitignore b/.gitignore index ed51829d..00eb3e66 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ js/ .vscode-upload.json .*.sw* node_modules -.phpunit*.cache +.php*.cache +/composer.lock /vendor/ diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 00000000..a459f30a --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,17 @@ +getFinder() + ->notPath('build') + ->notPath('l10n') + ->notPath('src') + ->notPath('node_modules') + ->notPath('vendor') + ->in(__DIR__); +return $config; diff --git a/composer.json b/composer.json index 6779097a..cb19da3d 100644 --- a/composer.json +++ b/composer.json @@ -1,12 +1,29 @@ { - "name": "nextcloud/assistant", - "authors": [ - { - "name": "Julien Veyssier", - "email": "julien-nc@posteo.net" - } - ], - "require": { - "php": "^8.0" - } + "name": "nextcloud/assistant", + "authors": [ + { + "name": "Julien Veyssier", + "email": "julien-nc@posteo.net" + }, + { + "name": "Sami Finnilä", + "email": "sami.finnila@nextcloud.com" + } + ], + "require": { + "php": "^8.0" + }, + "scripts": { + "lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l", + "cs:check": "php-cs-fixer fix --dry-run --diff", + "cs:fix": "php-cs-fixer fix", + "psalm": "psalm.phar", + "test:unit": "phpunit --config tests/phpunit.xml" + }, + "require-dev": { + "nextcloud/coding-standard": "^1.1", + "psalm/phar": "^5.16", + "nextcloud/ocp": "dev-master", + "phpunit/phpunit": "^9.5" + } } diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 41c1ab23..00000000 --- a/composer.lock +++ /dev/null @@ -1,20 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "05d27ab293134465a58e7e7a4b851bba", - "packages": [], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": "^7.4 || ^8.0" - }, - "platform-dev": [], - "plugin-api-version": "2.2.0" -} diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 1ddcb3e1..65a9c075 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -3,28 +3,26 @@ namespace OCA\TPAssistant\AppInfo; use OCA\TPAssistant\Listener\BeforeTemplateRenderedListener; +use OCA\TPAssistant\Listener\FreePrompt\FreePromptReferenceListener; use OCA\TPAssistant\Listener\TaskFailedListener; use OCA\TPAssistant\Listener\TaskSuccessfulListener; use OCA\TPAssistant\Listener\Text2Image\Text2ImageReferenceListener; -use OCA\TPAssistant\Reference\Text2ImageReferenceProvider; -use OCA\TPAssistant\Reference\FreePromptReferenceProvider; -use OCA\TPAssistant\Listener\FreePrompt\FreePromptReferenceListener; -use OCA\TPAssistant\Listener\FreePrompt\FreePromptResultListener; -use OCA\TPAssistant\Notification\Notifier; use OCA\TPAssistant\Listener\Text2Image\Text2ImageResultListener; -use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent; -use OCP\Collaboration\Reference\RenderReferenceEvent; - +use OCA\TPAssistant\Notification\Notifier; +use OCA\TPAssistant\Reference\FreePromptReferenceProvider; +use OCA\TPAssistant\Reference\Text2ImageReferenceProvider; use OCP\AppFramework\App; -use OCP\AppFramework\Bootstrap\IRegistrationContext; use OCP\AppFramework\Bootstrap\IBootContext; + use OCP\AppFramework\Bootstrap\IBootstrap; +use OCP\AppFramework\Bootstrap\IRegistrationContext; +use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent; +use OCP\Collaboration\Reference\RenderReferenceEvent; use OCP\TextProcessing\Events\TaskFailedEvent as TextTaskFailedEvent; use OCP\TextProcessing\Events\TaskSuccessfulEvent as TextTaskSuccessfulEvent; use OCP\TextToImage\Events\TaskFailedEvent as TextToImageTaskFailedEvent; use OCP\TextToImage\Events\TaskSuccessfulEvent as TextToImageTaskSuccessfulEvent; - class Application extends App implements IBootstrap { public const APP_ID = 'assistant'; @@ -62,4 +60,3 @@ public function register(IRegistrationContext $context): void { public function boot(IBootContext $context): void { } } - diff --git a/lib/Controller/AssistantController.php b/lib/Controller/AssistantController.php index ec0cf890..31553667 100644 --- a/lib/Controller/AssistantController.php +++ b/lib/Controller/AssistantController.php @@ -3,6 +3,7 @@ namespace OCA\TPAssistant\Controller; use OCA\TPAssistant\AppInfo\Application; +use OCA\TPAssistant\Service\AssistantService; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\BruteForceProtection; @@ -11,9 +12,8 @@ use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Services\IInitialState; -use OCP\IRequest; -use OCA\TPAssistant\Service\AssistantService; +use OCP\IRequest; class AssistantController extends Controller { diff --git a/lib/Controller/ConfigController.php b/lib/Controller/ConfigController.php index af6ad140..831fa25f 100644 --- a/lib/Controller/ConfigController.php +++ b/lib/Controller/ConfigController.php @@ -2,13 +2,13 @@ namespace OCA\TPAssistant\Controller; +use OCA\TPAssistant\AppInfo\Application; +use OCP\AppFramework\Controller; use OCP\AppFramework\Http\Attribute\NoAdminRequired; -use OCP\IConfig; -use OCP\IRequest; use OCP\AppFramework\Http\DataResponse; -use OCP\AppFramework\Controller; +use OCP\IConfig; -use OCA\TPAssistant\AppInfo\Application; +use OCP\IRequest; use OCP\PreConditionNotMetException; class ConfigController extends Controller { diff --git a/lib/Controller/FreePromptController.php b/lib/Controller/FreePromptController.php index f924a5ba..d7f72a98 100644 --- a/lib/Controller/FreePromptController.php +++ b/lib/Controller/FreePromptController.php @@ -6,18 +6,16 @@ namespace OCA\TPAssistant\Controller; use Exception; -use OCA\TPAssistant\AppInfo\Application; use OCA\TPAssistant\Service\FreePrompt\FreePromptService; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\Attribute\NoAdminRequired; +use OCP\AppFramework\Http\Attribute\NoCSRFRequired; use OCP\AppFramework\Http\DataResponse; -use OCP\AppFramework\Http\TemplateResponse; + use OCP\AppFramework\Services\IInitialState; use OCP\IRequest; -use OCP\AppFramework\Http\Attribute\NoAdminRequired; -use OCP\AppFramework\Http\Attribute\NoCSRFRequired; - class FreePromptController extends Controller { public function __construct( string $appName, diff --git a/lib/Controller/Text2ImageController.php b/lib/Controller/Text2ImageController.php index e373fae1..f1954c46 100644 --- a/lib/Controller/Text2ImageController.php +++ b/lib/Controller/Text2ImageController.php @@ -6,23 +6,24 @@ namespace OCA\TPAssistant\Controller; use Exception; -use OCP\Db\Exception as DbException; use OCA\TPAssistant\AppInfo\Application; use OCA\TPAssistant\Service\Text2Image\Text2ImageHelperService; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\Attribute\AnonRateLimit; use OCP\AppFramework\Http\Attribute\BruteForceProtection; +use OCP\AppFramework\Http\Attribute\NoAdminRequired; +use OCP\AppFramework\Http\Attribute\NoCSRFRequired; +use OCP\AppFramework\Http\Attribute\PublicPage; use OCP\AppFramework\Http\DataDisplayResponse; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Services\IInitialState; + +use OCP\Db\Exception as DbException; use OCP\IRequest; use OCP\TextToImage\Exception\TaskFailureException; -use OCP\AppFramework\Http\Attribute\AnonRateLimit; -use OCP\AppFramework\Http\Attribute\NoAdminRequired; -use OCP\AppFramework\Http\Attribute\NoCSRFRequired; -use OCP\AppFramework\Http\Attribute\PublicPage; class Text2ImageController extends Controller { public function __construct( string $appName, @@ -141,8 +142,8 @@ public function setVisibilityOfImageFiles(string $imageGenId, array $fileVisStat } catch (Exception $e) { $response = new DataResponse(['error' => $e->getMessage()], $e->getCode()); if($e->getCode() === Http::STATUS_BAD_REQUEST | Http::STATUS_UNAUTHORIZED) { - // Throttle brute force attempts - $response->throttle(['action' => 'imageGenId']); + // Throttle brute force attempts + $response->throttle(['action' => 'imageGenId']); } return $response; } @@ -152,8 +153,8 @@ public function setVisibilityOfImageFiles(string $imageGenId, array $fileVisStat /** * Notify when image generation is ready - * - * Does not need bruteforce protection since we respond with success anyways + * + * Does not need bruteforce protection since we respond with success anyways * as we don't want to keep the front-end waiting. * However, we still use rate limiting to prevent timing attacks. */ @@ -170,11 +171,11 @@ public function notifyWhenReady(string $imageGenId): DataResponse { } /** * Cancel image generation - * + * * Does not need bruteforce protection since we respond with success anyways * (In theory bruteforce may be possible by a response timing attack but the attacker * won't gain access to the generation since its deleted during the attack.) - * + * * @param string $imageGenId * @return DataResponse */ @@ -205,7 +206,7 @@ public function showGenerationPage(?string $imageGenId, ?bool $forceEditMode = f $this->initialStateService->provideInitialState('generation-page-inputs', ['image_gen_id' => $imageGenId, 'force_edit_mode' => $forceEditMode]); } else { $this->initialStateService->provideInitialState('generation-page-inputs', ['image_gen_id' => $imageGenId, 'force_edit_mode' => $forceEditMode]); - } + } return new TemplateResponse(Application::APP_ID, 'imageGenerationPage'); } diff --git a/lib/Cron/CleanupImageGenerations.php b/lib/Cron/CleanupImageGenerations.php index b3a4e80c..ec15d76d 100644 --- a/lib/Cron/CleanupImageGenerations.php +++ b/lib/Cron/CleanupImageGenerations.php @@ -6,12 +6,12 @@ namespace OCA\TPAssistant\Cron; +use Exception; use OCA\TPAssistant\Db\Text2Image\ImageGenerationMapper; use OCA\TPAssistant\Service\Text2Image\CleanUpService; use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\TimedJob; use Psr\Log\LoggerInterface; -use Exception; class CleanupImageGenerations extends TimedJob { public function __construct( diff --git a/lib/Db/FreePrompt/PromptMapper.php b/lib/Db/FreePrompt/PromptMapper.php index c2b96426..73aae1d6 100644 --- a/lib/Db/FreePrompt/PromptMapper.php +++ b/lib/Db/FreePrompt/PromptMapper.php @@ -15,6 +15,7 @@ use OCP\DB\Exception; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; + /** * @implements QBMapper */ @@ -182,7 +183,7 @@ public function cleanupUserPrompts(string $userId): void { $lastPromptTs = []; /** @var mixed[] $row */ - while ($row = $req->fetch()) { + while ($row = $req->fetch()) { $lastPromptTs[] = (int)$row['timestamp']; } $req->closeCursor(); diff --git a/lib/Listener/BeforeTemplateRenderedListener.php b/lib/Listener/BeforeTemplateRenderedListener.php index 12095458..8f430c6c 100644 --- a/lib/Listener/BeforeTemplateRenderedListener.php +++ b/lib/Listener/BeforeTemplateRenderedListener.php @@ -13,8 +13,8 @@ use OCP\IConfig; use OCP\IUser; use OCP\IUserSession; -use OCP\Util; use OCP\TextProcessing\IManager as ITextProcessingManager; +use OCP\Util; class BeforeTemplateRenderedListener implements IEventListener { diff --git a/lib/Listener/FreePrompt/FreePromptReferenceListener.php b/lib/Listener/FreePrompt/FreePromptReferenceListener.php index f37217a4..1ff9be33 100644 --- a/lib/Listener/FreePrompt/FreePromptReferenceListener.php +++ b/lib/Listener/FreePrompt/FreePromptReferenceListener.php @@ -12,11 +12,11 @@ use OCP\EventDispatcher\IEventListener; use OCP\IConfig; use OCP\IGroupManager; -use OCP\TextProcessing\FreePromptTaskType; use OCP\TextProcessing\IManager; use OCP\Util; use Psr\Log\LoggerInterface; + /** * @implements IEventListener */ diff --git a/lib/Listener/Text2Image/Text2ImageReferenceListener.php b/lib/Listener/Text2Image/Text2ImageReferenceListener.php index b0b36004..b99d99d8 100644 --- a/lib/Listener/Text2Image/Text2ImageReferenceListener.php +++ b/lib/Listener/Text2Image/Text2ImageReferenceListener.php @@ -10,8 +10,8 @@ use OCP\Collaboration\Reference\RenderReferenceEvent; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; -use OCP\TextToImage\IManager; use OCP\IConfig; +use OCP\TextToImage\IManager; use OCP\Util; class Text2ImageReferenceListener implements IEventListener { @@ -36,6 +36,6 @@ public function handle(Event $event): void { if ($this->manager->hasProviders()) { Util::addScript(Application::APP_ID, Application::APP_ID . '-imageGenerationReference'); } - } + } } } diff --git a/lib/Listener/Text2Image/Text2ImageResultListener.php b/lib/Listener/Text2Image/Text2ImageResultListener.php index 9853219a..16cc07ae 100644 --- a/lib/Listener/Text2Image/Text2ImageResultListener.php +++ b/lib/Listener/Text2Image/Text2ImageResultListener.php @@ -4,17 +4,17 @@ use OCA\TPassistant\AppInfo\Application; use OCA\TPAssistant\Db\Text2Image\ImageGenerationMapper; -use OCA\TPAssistant\Service\Text2Image\Text2ImageHelperService; use OCA\TPAssistant\Service\AssistantService; +use OCA\TPAssistant\Service\Text2Image\Text2ImageHelperService; use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Db\MultipleObjectsReturnedException; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; use OCP\IImage; +use OCP\IURLGenerator; use OCP\TextToImage\Events\AbstractTextToImageEvent; use OCP\TextToImage\Events\TaskFailedEvent; use OCP\TextToImage\Events\TaskSuccessfulEvent; -use OCP\IURLGenerator; use Psr\Log\LoggerInterface; class Text2ImageResultListener implements IEventListener { diff --git a/lib/Migration/Version010003Date20231208083112.php b/lib/Migration/Version010003Date20231208083112.php index 422fdb2e..10e5a2e8 100644 --- a/lib/Migration/Version010003Date20231208083112.php +++ b/lib/Migration/Version010003Date20231208083112.php @@ -1,4 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/lib/Service/AssistantService.php b/lib/Service/AssistantService.php index 7305f551..3ef5aae3 100644 --- a/lib/Service/AssistantService.php +++ b/lib/Service/AssistantService.php @@ -5,11 +5,11 @@ use DateTime; use OCA\TPAssistant\AppInfo\Application; use OCP\Common\Exception\NotFoundException; +use OCP\Notification\IManager as INotificationManager; use OCP\PreConditionNotMetException; use OCP\TextProcessing\IManager as ITextProcessingManager; use OCP\TextProcessing\Task as TextProcessingTask; use OCP\TextToImage\Task as TextToImageTask; -use OCP\Notification\IManager as INotificationManager; class AssistantService { diff --git a/lib/Service/FreePrompt/FreePromptService.php b/lib/Service/FreePrompt/FreePromptService.php index bf532029..dce67d3a 100644 --- a/lib/Service/FreePrompt/FreePromptService.php +++ b/lib/Service/FreePrompt/FreePromptService.php @@ -53,7 +53,7 @@ public function processPrompt(string $prompt, int $nResults): string { while (true) { $genId = bin2hex(random_bytes(32)); // Exceedingly unlikely that this will ever happen, but just in case: - if(count($this->textProcessingManager->getUserTasksByApp($this->userId,Application::APP_ID,$genId)) === 0) { + if(count($this->textProcessingManager->getUserTasksByApp($this->userId, Application::APP_ID, $genId)) === 0) { break; } else { continue; diff --git a/lib/Service/Text2Image/Text2ImageHelperService.php b/lib/Service/Text2Image/Text2ImageHelperService.php index c7714f07..f1370241 100644 --- a/lib/Service/Text2Image/Text2ImageHelperService.php +++ b/lib/Service/Text2Image/Text2ImageHelperService.php @@ -51,7 +51,7 @@ class Text2ImageHelperService { * @param IAppData $appData * @param IURLGenerator $urlGenerator * @param IL10N $l10n - * @param AssistantService $assistantService + * @param AssistantService $assistantService */ public function __construct( private IConfig $config, @@ -325,8 +325,7 @@ public function getGenerationInfo(string $imageGenId, bool $updateTimestamp = tr $this->logger->debug('Image request error : ' . $e->getMessage(), ['app' => Application::APP_ID]); // Set error code to BAD_REQUEST to limit brute force attempts throw new BaseException($this->l10n->t('Image generation not found.'), Http::STATUS_BAD_REQUEST); - } - catch (Exception | MultipleObjectsReturnedException $e) { + } catch (Exception | MultipleObjectsReturnedException $e) { $this->logger->debug('Image request error : ' . $e->getMessage(), ['app' => Application::APP_ID]); throw new BaseException($this->l10n->t('Retrieving the image generation failed.'), Http::STATUS_INTERNAL_SERVER_ERROR); } @@ -476,7 +475,7 @@ public function cancelGeneration(string $imageGenId): void { } } } - } + } } // Remove the image generation from the database: @@ -533,7 +532,7 @@ public function setVisibilityOfImageFiles(string $imageGenId, array $fileVisSatu */ public function notifyWhenReady(string $imageGenId): void { try { - $imageGeneration = $this->imageGenerationMapper->getImageGenerationOfImageGenId($imageGenId); + $imageGeneration = $this->imageGenerationMapper->getImageGenerationOfImageGenId($imageGenId); } catch (DoesNotExistException $e) { $this->logger->debug('Image request error : ' . $e->getMessage()); // Check if the generation has been deleted before this notify request was made: diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index 31bddeab..5925c63a 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -1,14 +1,15 @@ textProcessingManager->hasProviders(); $freePromptTaskTypeAvailable = in_array(FreePromptTaskType::class, $this->textProcessingManager->getAvailableTaskTypes()); $assistantEnabled = $this->config->getAppValue(Application::APP_ID, 'assistant_enabled', '1') === '1'; - $textToImagePickerAvailable = $this->textToImageManager->hasProviders(); + $textToImagePickerAvailable = $this->textToImageManager->hasProviders(); $textToImagePickerEnabled = $this->config->getAppValue(Application::APP_ID, 'text_to_image_picker_enabled', '1') === '1'; $maxImageGenerationIdleTime = $this->config->getAppValue(Application::APP_ID, 'max_image_generation_idle_time', Application::DEFAULT_MAX_IMAGE_GENERATION_IDLE_TIME); $freePromptPickerEnabled = $this->config->getAppValue(Application::APP_ID, 'free_prompt_picker_enabled', '1') === '1'; diff --git a/lib/Settings/Personal.php b/lib/Settings/Personal.php index e8492a23..2207bf04 100644 --- a/lib/Settings/Personal.php +++ b/lib/Settings/Personal.php @@ -1,14 +1,15 @@ config->getAppValue(Application::APP_ID, 'assistant_enabled', '1') === '1'; $assistantEnabled = $this->config->getUserValue($this->userId, Application::APP_ID, 'assistant_enabled', '1') === '1'; - $textToImagePickerAvailable = $this->textToImageManager->hasProviders() && $this->config->getAppValue(Application::APP_ID, 'text_to_image_picker_enabled', '1') === '1'; false; + $textToImagePickerAvailable = $this->textToImageManager->hasProviders() && $this->config->getAppValue(Application::APP_ID, 'text_to_image_picker_enabled', '1') === '1'; + false; $textToImagePickerEnabled = $this->config->getUserValue($this->userId, Application::APP_ID, 'text_to_image_picker_enabled', '1') === '1'; $freePromptPickerAvailable = $freePromptTaskTypeAvailable && $this->config->getAppValue(Application::APP_ID, 'free_prompt_picker_enabled', '1') === '1'; diff --git a/lib/Settings/PersonalSection.php b/lib/Settings/PersonalSection.php index 61c72521..b37e0334 100644 --- a/lib/Settings/PersonalSection.php +++ b/lib/Settings/PersonalSection.php @@ -1,8 +1,9 @@ diff --git a/tests/bootstrap.php b/tests/bootstrap.php index c2656e2b..d1e2a812 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -2,8 +2,8 @@ require_once __DIR__ . '/../../../tests/bootstrap.php'; -use OCP\App\IAppManager; use OCA\TPAssistant\AppInfo\Application; +use OCP\App\IAppManager; \OC::$server->get(IAppManager::class)->loadApp(Application::APP_ID); //\OC_App::loadApp(Application::APP_ID);