Skip to content

Commit

Permalink
Merge branch 'v2.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
Padam87 committed Aug 3, 2022
2 parents 0660177 + e04af5e commit 0477131
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
pull_request:
branches:
- "master"
- "v2.x"
push:
branches:
- "master"
- "v2.x"

jobs:
phpunit:
Expand Down
5 changes: 4 additions & 1 deletion Tests/HelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,11 @@ public function should_process_jobs()

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

// logFile parameter
$this->assertEquals($this->getConfig()['log_dir'] . '/myjob.log', $job->logFile);

// commandLine parameter
$this->assertStringStartsWith($this->getConfig()['php_binary'], $job->commandLine);
$this->assertStringEndsWith('my:job', $job->commandLine);
$this->assertStringEndsWith('my:job 42 --first-option --second-option true', $job->commandLine);
}
}
2 changes: 1 addition & 1 deletion Tests/Resources/Command/ProcessTestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Padam87\CronBundle\Attribute\Job;
use Symfony\Component\Console\Command\Command;

#[Job(logFile: 'myjob.log')]
#[Job(group: 'my-group', logFile: 'myjob.log', commandLine: 'my:job 42 --first-option --second-option true')]
class ProcessTestCommand extends Command
{
protected static $defaultName = 'my:job';
Expand Down
2 changes: 1 addition & 1 deletion Util/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private function processJob(Job $job, InputInterface $input, array $config, Comm
'%s %s %s',
$config['php_binary'],
realpath($_SERVER['argv'][0]),
$annotation->commandLine ?? $commandInstance->getName()
$job->commandLine ?? $commandInstance->getName()
);

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

0 comments on commit 0477131

Please sign in to comment.