File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
src/Illuminate/Foundation/Console
tests/Integration/Foundation/Console Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,13 @@ class ClosureCommand extends Command
25
25
*/
26
26
protected $ callback ;
27
27
28
+ /**
29
+ * The console command description.
30
+ *
31
+ * @var string
32
+ */
33
+ protected $ description = '' ;
34
+
28
35
/**
29
36
* Create a new command instance.
30
37
*
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Illuminate \Tests \Integration \Foundation \Console ;
4
+
5
+ use Illuminate \Support \Facades \Artisan ;
6
+ use Orchestra \Testbench \TestCase ;
7
+
8
+ class ClosureCommandTest extends TestCase
9
+ {
10
+ /** {@inheritDoc} */
11
+ #[\Override]
12
+ protected function defineEnvironment ($ app )
13
+ {
14
+ Artisan::command ('inspire ' , function () {
15
+ $ this ->comment ('We must ship. - Taylor Otwell ' );
16
+ })->purpose ('Display an inspiring quote ' );
17
+ }
18
+
19
+ public function testItCanRunClosureCommand ()
20
+ {
21
+ $ this ->artisan ('inspire ' )->expectsOutput ('We must ship. - Taylor Otwell ' );
22
+ }
23
+ }
You can’t perform that action at this time.
0 commit comments