From a418522e21a55ff0b40b5cd136879e5a67b6e3a1 Mon Sep 17 00:00:00 2001 From: Dennis Benz Date: Thu, 12 Dec 2024 15:37:20 +0100 Subject: [PATCH] Fix file check in run cronjob --- tests/_support/Helper/Api.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/_support/Helper/Api.php b/tests/_support/Helper/Api.php index a1043c8d..82c6847b 100644 --- a/tests/_support/Helper/Api.php +++ b/tests/_support/Helper/Api.php @@ -22,7 +22,7 @@ class Api extends \Codeception\Module 'course_id', ]; - const STUDIP_DIR = __DIR__ . '/../../../../../../../'; + const STUDIP_CLI = __DIR__ . '/../../../../../../../cli/studip'; public function getConfig(): array { return $this->config; @@ -63,9 +63,9 @@ public function seeVideoIsProcessed($id): bool { */ public function runCronjob(string $cronjob) { - if (is_dir(self::STUDIP_DIR)) { - // Run cronjob on host if studip code exist - $studip_cli = self::STUDIP_DIR . "cli/studip"; + if (file_exists(self::STUDIP_CLI)) { + // Run cronjob on host if studip cli exist + $studip_cli = self::STUDIP_CLI; $command = "php $studip_cli cronjobs:execute $(php $studip_cli cronjobs:list | grep '$cronjob' | awk '{print $1}')"; } else { // Run cronjob in docker container