Skip to content

Commit 0477131

Browse files
committed
Merge branch 'v2.x'
2 parents 0660177 + e04af5e commit 0477131

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ on:
44
pull_request:
55
branches:
66
- "master"
7+
- "v2.x"
78
push:
89
branches:
910
- "master"
11+
- "v2.x"
1012

1113
jobs:
1214
phpunit:

Tests/HelperTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,11 @@ public function should_process_jobs()
129129

130130
$job = $tab->getJobs()[0];
131131

132+
// logFile parameter
132133
$this->assertEquals($this->getConfig()['log_dir'] . '/myjob.log', $job->logFile);
134+
135+
// commandLine parameter
133136
$this->assertStringStartsWith($this->getConfig()['php_binary'], $job->commandLine);
134-
$this->assertStringEndsWith('my:job', $job->commandLine);
137+
$this->assertStringEndsWith('my:job 42 --first-option --second-option true', $job->commandLine);
135138
}
136139
}

Tests/Resources/Command/ProcessTestCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Padam87\CronBundle\Attribute\Job;
66
use Symfony\Component\Console\Command\Command;
77

8-
#[Job(logFile: 'myjob.log')]
8+
#[Job(group: 'my-group', logFile: 'myjob.log', commandLine: 'my:job 42 --first-option --second-option true')]
99
class ProcessTestCommand extends Command
1010
{
1111
protected static $defaultName = 'my:job';

Util/Helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private function processJob(Job $job, InputInterface $input, array $config, Comm
6363
'%s %s %s',
6464
$config['php_binary'],
6565
realpath($_SERVER['argv'][0]),
66-
$annotation->commandLine ?? $commandInstance->getName()
66+
$job->commandLine ?? $commandInstance->getName()
6767
);
6868

6969
if ($config['log_dir'] !== null && $job->logFile !== null) {

0 commit comments

Comments
 (0)