| Conditions | 1 |
| Paths | 1 |
| Total Lines | 32 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function testGetProcess() |
||
| 23 | { |
||
| 24 | $scriptName = uniqid('script_'); |
||
| 25 | $binPath = __DIR__; |
||
| 26 | |||
| 27 | $jobProcess = new JobProcess($scriptName, $binPath); |
||
| 28 | |||
| 29 | $jobId = uniqid('id_'); |
||
| 30 | $jobQueue = uniqid('queue_'); |
||
| 31 | |||
| 32 | $job = $this->createMock(JobContractInterface::class); |
||
| 33 | $job |
||
| 34 | ->expects(self::exactly(2)) |
||
| 35 | ->method('getJobId') |
||
| 36 | ->willReturn($jobId); |
||
| 37 | $job |
||
| 38 | ->expects(self::exactly(2)) |
||
| 39 | ->method('getQueue') |
||
| 40 | ->willReturn($jobQueue); |
||
| 41 | |||
| 42 | $connectionName = uniqid('connection_'); |
||
| 43 | |||
| 44 | $job |
||
| 45 | ->method('getConnectionName') |
||
| 46 | ->willReturn($connectionName); |
||
| 47 | |||
| 48 | $process = $jobProcess->getProcess($job, new Options()); |
||
|
|
|||
| 49 | |||
| 50 | $command = sprintf('%s %s job-queue:run-job %s --connection=%s --queue=%s --env=%s --delay=0 --memory=128 --timeout=60 --sleep=3 --maxTries=0 > /dev/null 2>&1 &', 'php', $binPath . DIRECTORY_SEPARATOR . $scriptName, $job->getJobId(), $connectionName, $job->getQueue(), 'prod'); |
||
| 51 | |||
| 52 | self::assertEquals($command, $process->getCommandLine()); |
||
| 53 | } |
||
| 54 | } |
||
| 55 |
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: