Skip to content

Commit

Permalink
Fix file check in run cronjob
Browse files Browse the repository at this point in the history
  • Loading branch information
dennis531 committed Dec 12, 2024
1 parent 3191024 commit a418522
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/_support/Helper/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a418522

Please sign in to comment.