Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Illuminate/Foundation/Console/ClosureCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ class ClosureCommand extends Command
*/
protected $callback;

/**
* The console command description.
*
* @var string
*/
protected $description = '';

/**
* Create a new command instance.
*
Expand Down
23 changes: 23 additions & 0 deletions tests/Integration/Foundation/Console/ClosureCommandTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Illuminate\Tests\Integration\Foundation\Console;

use Illuminate\Support\Facades\Artisan;
use Orchestra\Testbench\TestCase;

class ClosureCommandTest extends TestCase
{
/** {@inheritDoc} */
#[\Override]
protected function defineEnvironment($app)
{
Artisan::command('inspire', function () {
$this->comment('We must ship. - Taylor Otwell');
})->purpose('Display an inspiring quote');
}

public function testItCanRunClosureCommand()
{
$this->artisan('inspire')->expectsOutput('We must ship. - Taylor Otwell');
}
}