Skip to content

Commit dddac4c

Browse files
committed
Updates default command
1 parent ede6a7d commit dddac4c

File tree

3 files changed

+23
-30
lines changed

3 files changed

+23
-30
lines changed

Diff for: app/Commands/HelloCommand.php renamed to app/Commands/InspiringCommand.php

+7-13
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,36 @@
55
use Illuminate\Console\Scheduling\Schedule;
66
use LaravelZero\Framework\Commands\Command;
77

8-
class HelloCommand extends Command
8+
class InspiringCommand extends Command
99
{
1010
/**
11-
* The name and signature of the command.
11+
* The signature of the command.
1212
*
1313
* @var string
1414
*/
15-
protected $signature = 'hello {name=Artisan}';
15+
protected $signature = 'inspiring {name=Artisan}';
1616

1717
/**
1818
* The description of the command.
1919
*
2020
* @var string
2121
*/
22-
protected $description = 'Displays an "Hello" message';
22+
protected $description = 'Display an inspiring quote';
2323

2424
/**
25-
* Execute the command. Here goes the code.
26-
*
27-
* @return void
25+
* Execute the console command.
2826
*/
2927
public function handle(): void
3028
{
31-
$this->info('Love beautiful code? We do too.');
32-
33-
$this->notify('Hello '.$this->argument('name'), 'Enjoy the fresh air!');
29+
$this->info('Simplicity is the ultimate sophistication. - Leonardo da Vinci');
3430

35-
$this->comment('Wanna see more? Type `php your-app-name list`');
31+
$this->notify('Hey ' . $this->argument('name'), 'Enjoy the fresh air!');
3632
}
3733

3834
/**
3935
* Define the command's schedule.
4036
*
4137
* @param \Illuminate\Console\Scheduling\Schedule $schedule
42-
*
43-
* @return void
4438
*/
4539
public function schedule(Schedule $schedule): void
4640
{

Diff for: tests/Integration/HelloCommandTest.php

-17
This file was deleted.

Diff for: tests/Integration/InspiringCommandTest.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Tests\Integration;
4+
5+
use Tests\TestCase;
6+
7+
class InspiringCommandTest extends TestCase
8+
{
9+
/** @test */
10+
public function it_checks_the_inspire_sentence(): void
11+
{
12+
$this->app->call('inspiring');
13+
14+
$this->assertContains('Simplicity is the ultimate sophistication. - Leonardo da Vinci', $this->app->output());
15+
}
16+
}

0 commit comments

Comments
 (0)