File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
src/Illuminate/Foundation/Console
tests/Integration/Console Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -39,4 +39,14 @@ public function handle(KernelContract $kernel)
39
39
{
40
40
$ kernel ->call (...array_values ($ this ->data ));
41
41
}
42
+
43
+ /**
44
+ * Get the display name for the queued job.
45
+ *
46
+ * @return string
47
+ */
48
+ public function displayName ()
49
+ {
50
+ return array_values ($ this ->data )[0 ];
51
+ }
42
52
}
Original file line number Diff line number Diff line change 5
5
use Illuminate \Console \Command ;
6
6
use Illuminate \Console \Scheduling \Schedule ;
7
7
use Illuminate \Contracts \Console \Kernel ;
8
+ use Illuminate \Foundation \Console \QueuedCommand ;
9
+ use Illuminate \Support \Facades \Queue ;
8
10
use Orchestra \Testbench \TestCase ;
9
11
10
12
class ConsoleApplicationTest extends TestCase
@@ -65,6 +67,19 @@ public function testArtisanInstantiateScheduleWhenNeed()
65
67
66
68
$ this ->assertTrue ($ this ->app ->resolved (Schedule::class));
67
69
}
70
+
71
+ public function testArtisanQueue ()
72
+ {
73
+ Queue::fake ();
74
+
75
+ $ this ->app [Kernel::class]->queue ('foo:bar ' , [
76
+ 'id ' => 1 ,
77
+ ]);
78
+
79
+ Queue::assertPushed (QueuedCommand::class, function ($ job ) {
80
+ return $ job ->displayName () === 'foo:bar ' ;
81
+ });
82
+ }
68
83
}
69
84
70
85
class FooCommandStub extends Command
You can’t perform that action at this time.
0 commit comments