Skip to content

Commit

Permalink
chore: guard for L11
Browse files Browse the repository at this point in the history
  • Loading branch information
arkaitzgarro committed Apr 7, 2024
1 parent b69e1d6 commit 80f651c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/unit/Collectors/JobCollectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Illuminate\Queue\Events\JobProcessed;
use Illuminate\Queue\Events\JobProcessing;
use Illuminate\Queue\Jobs\SyncJob;
use Illuminate\Support\Facades\Context;
use Illuminate\Support\Facades\Log;
use Nipwaayoni\Events\Transaction;
use Nipwaayoni\Exception\Transaction\UnknownTransactionException;
Expand Down Expand Up @@ -105,11 +104,14 @@ public function testJobProcessingListenerIgnored()
{
$this->patternConfigReturn(self::JOB_IGNORE_PATTERN);
$this->jobMock->shouldReceive('resolveName')->once()->andReturn(self::JOB_NAME);
$this->jobMock->shouldReceive('payload');
$this->agentMock->shouldNotReceive('startTransaction');
$this->agentMock->shouldNotReceive('getTransaction');

Context::shouldReceive('hydrate');

// For Laravel 11+
if (class_exists('\Illuminate\Support\Facades\Context')) {
\Illuminate\Support\Facades\Context::shouldReceive('hydrate');
$this->jobMock->shouldReceive('payload');
}

$this->dispatcher->dispatch(new JobProcessing('test', $this->jobMock));
}
Expand Down

0 comments on commit 80f651c

Please sign in to comment.