for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace JCIT\jobqueue\tests\unit\components\jobQueues;
use Codeception\Test\Unit;
use JCIT\jobqueue\components\jobQueues\Synchronous;
use JCIT\jobqueue\interfaces\JobInterface;
use JCIT\jobqueue\jobs\HelloJob;
use League\Tactician\CommandBus;
class SynchronousTest extends Unit
{
public function testPut(): void
$commandBus = $this->createMock(CommandBus::class);
$counter = 0;
$beforePut = static function (JobInterface $job) use (&$counter) {
$job
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
$beforePut = static function (/** @scrutinizer ignore-unused */ JobInterface $job) use (&$counter) {
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$counter++;
};
$jobQueue = new Synchronous($commandBus, $beforePut);
$job = new HelloJob('Test');
$jobQueue->putJob($job);
$this->assertEquals(1, $counter);
}
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.