the browser-facing portion of osu!
at master 28 lines 736 B view raw
1<?php 2 3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. 4// See the LICENCE file in the repository root for full licence text. 5 6declare(strict_types=1); 7 8namespace Tests\Jobs; 9 10use Illuminate\Queue\Events\JobProcessed; 11use Queue; 12use Tests\TestCase; 13 14class JobNameTest extends TestCase 15{ 16 public function testDisplayName() 17 { 18 $job = new TestJob('test'); 19 20 Queue::after(function (JobProcessed $event) use ($job) { 21 $payload = $event->job->payload(); 22 $this->assertSame($job::class, $payload['data']['commandName']); 23 $this->assertSame($job->displayName(), $payload['displayName']); 24 }); 25 26 dispatch($job); 27 } 28}