Conditions | 1 |
Paths | 1 |
Total Lines | 30 |
Code Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public function testGetProcess() |
||
22 | { |
||
23 | $scriptName = uniqid('script_'); |
||
24 | $binPath = __DIR__; |
||
25 | $binary = 'php'; |
||
26 | $binaryArgs = ''; |
||
27 | |||
28 | $jobProcess = new JobProcess($scriptName, $binPath, $binary, $binaryArgs); |
||
29 | |||
30 | $jobId = uniqid('id_'); |
||
31 | $jobQueue = uniqid('queue_'); |
||
32 | |||
33 | $job = $this->createMock(JobContractInterface::class); |
||
34 | $job |
||
35 | ->expects($this->exactly(2)) |
||
36 | ->method('getJobId') |
||
37 | ->will($this->returnValue($jobId)); |
||
38 | $job |
||
39 | ->expects($this->exactly(2)) |
||
40 | ->method('getQueue') |
||
41 | ->will($this->returnValue($jobQueue)); |
||
42 | |||
43 | $connectionName = uniqid('connection_'); |
||
44 | |||
45 | $process = $jobProcess->getProcess($job, $connectionName); |
||
|
|||
46 | |||
47 | $command = sprintf("'php' %s job-queue:run-job %s --connection=%s --queue=%s --env=%s > /dev/null 2>&1 &", $scriptName, $job->getJobId(), $connectionName, $job->getQueue(), getenv('APP_ENV')); |
||
48 | |||
49 | $this->assertEquals($command, $process->getCommandLine()); |
||
50 | } |
||
51 | } |
||
52 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: