Skip to content

Commit

Permalink
Add another variable to the output
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Sep 17, 2024
1 parent 9a11729 commit c6c22a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions tests/CronBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function it_builds(): void

$expected = <<<CRON
###> Generated by PHPUnit ###
0 0 * * * /usr/bin/php /home/johndoe/public_html/send-report.php --verbose # Run every day at midnight
0 0 * * * /usr/bin/php /home/johndoe/public_html/12/send-report.php --verbose # Run every day at midnight
###< Generated by PHPUnit ###
CRON;
Expand All @@ -38,8 +38,8 @@ public function it_builds_with_prod_env_set(): void

$expected = <<<CRON
###> Generated by PHPUnit ###
0 0 * * * /usr/bin/php /home/johndoe/public_html/send-report.php --verbose # Run every day at midnight
0 0 * * * /usr/bin/php /home/johndoe/public_html/process.php --verbose
0 0 * * * /usr/bin/php /home/johndoe/public_html/12/send-report.php --verbose # Run every day at midnight
0 0 * * * /usr/bin/php /home/johndoe/public_html/12/process.php --verbose
###< Generated by PHPUnit ###
CRON;
Expand All @@ -58,7 +58,7 @@ public function it_merges(): void
0 0 * * * /usr/bin/php /home/johndoe/public_html/other-job.php
###> Generated by PHPUnit ###
0 0 * * * /usr/bin/php /home/johndoe/public_html/delete-files.php
0 0 * * * /usr/bin/php /home/johndoe/public_html/12/delete-files.php
###< Generated by PHPUnit ###
Expand All @@ -70,7 +70,7 @@ public function it_merges(): void
0 0 * * * /usr/bin/php /home/johndoe/public_html/other-job.php
###> Generated by PHPUnit ###
0 0 * * * /usr/bin/php /home/johndoe/public_html/send-report.php --verbose # Run every day at midnight
0 0 * * * /usr/bin/php /home/johndoe/public_html/12/send-report.php --verbose # Run every day at midnight
###< Generated by PHPUnit ###
CRON;
Expand Down
4 changes: 2 additions & 2 deletions tests/cronjobs/jobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
use Setono\CronBuilder\CronJob;

return static function (Context $context): iterable {
yield new CronJob('0 0 * * *', '/usr/bin/php {{ release_path }}/send-report.php {{ args|join(" ") }}', 'Run every day at midnight');
yield new CronJob('0 0 * * *', '/usr/bin/php {{ release_path }}/{{ release_number }}/send-report.php {{ args|join(" ") }}', 'Run every day at midnight');

if ($context->get('env') === 'prod') {
yield new CronJob('0 0 * * *', '/usr/bin/php {{ release_path }}/process.php {{ args|join(" ") }}');
yield new CronJob('0 0 * * *', '/usr/bin/php {{ release_path }}/{{ release_number }}/process.php {{ args|join(" ") }}');
}
};

0 comments on commit c6c22a3

Please sign in to comment.