|
5 | 5 | use Firebase\JWT\ExpiredException; |
6 | 6 | use Google\Cloud\Tasks\V2\RetryConfig; |
7 | 7 | use Google\Protobuf\Duration; |
8 | | -use Illuminate\Database\Eloquent\Model; |
9 | | -use Illuminate\Queue\Events\JobExceptionOccurred; |
10 | | -use Illuminate\Queue\Events\JobFailed; |
11 | 8 | use Illuminate\Queue\Events\JobProcessed; |
12 | 9 | use Illuminate\Queue\Events\JobProcessing; |
13 | | -use Illuminate\Support\Facades\DB; |
14 | 10 | use Illuminate\Support\Facades\Event; |
15 | 11 | use Illuminate\Support\Facades\Log; |
16 | | -use Illuminate\Support\Facades\Queue; |
17 | 12 | use Stackkit\LaravelGoogleCloudTasksQueue\CloudTasksApi; |
18 | 13 | use Stackkit\LaravelGoogleCloudTasksQueue\CloudTasksException; |
19 | | -use Stackkit\LaravelGoogleCloudTasksQueue\CloudTasksJob; |
20 | 14 | use Stackkit\LaravelGoogleCloudTasksQueue\LogFake; |
21 | 15 | use Stackkit\LaravelGoogleCloudTasksQueue\OpenIdVerificator; |
22 | 16 | use Stackkit\LaravelGoogleCloudTasksQueue\StackkitCloudTask; |
| 17 | +use Tests\Support\EncryptedJob; |
23 | 18 | use Tests\Support\FailingJob; |
24 | 19 | use Tests\Support\SimpleJob; |
25 | 20 | use UnexpectedValueException; |
@@ -272,4 +267,22 @@ public function test_max_attempts_in_combination_with_retry_until() |
272 | 267 |
|
273 | 268 | $this->assertEquals('failed', $task->fresh()->status); |
274 | 269 | } |
| 270 | + |
| 271 | + /** |
| 272 | + * @test |
| 273 | + */ |
| 274 | + public function it_can_handle_encrypted_jobs() |
| 275 | + { |
| 276 | + // Arrange |
| 277 | + OpenIdVerificator::fake(); |
| 278 | + Log::swap(new LogFake()); |
| 279 | + |
| 280 | + // Act |
| 281 | + $job = $this->dispatch(new EncryptedJob()); |
| 282 | + $job->run(); |
| 283 | + |
| 284 | + // Assert |
| 285 | + $this->assertEquals('O:26:"Tests\Support\EncryptedJob":0:{}', decrypt($job->payload['data']['command'])); |
| 286 | + Log::assertLogged('EncryptedJob:success'); |
| 287 | + } |
275 | 288 | } |
0 commit comments