| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 17 | public function testPut(): void |
||
| 18 | { |
||
| 19 | $connection = $this->createMock(Connection::class); |
||
| 20 | $jobFactory = $this->createMock(JobFactory::class); |
||
| 21 | $counter = 0; |
||
| 22 | $beforePut = static function (JobInterface $job) use (&$counter) { |
||
|
|
|||
| 23 | $counter++; |
||
| 24 | }; |
||
| 25 | |||
| 26 | $jobQueue = $this->getMockBuilder(Beanstalk::class) |
||
| 27 | ->setConstructorArgs([$connection, $jobFactory, $beforePut]) |
||
| 28 | ->onlyMethods(['put']) |
||
| 29 | ->getMock(); |
||
| 30 | ; |
||
| 31 | |||
| 32 | $jobQueue->expects($this->once())->method('put'); |
||
| 33 | |||
| 34 | $job = new HelloJob('Test'); |
||
| 35 | $jobQueue->putJob($job); |
||
| 36 | $this->assertEquals(1, $counter); |
||
| 37 | } |
||
| 39 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.