feat: add monica:getversion command (#6965)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class GetVersion extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'monica:getversion';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Get current version of monica';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
$this->line(config('monica.app_version'));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Commands;
|
||||
|
||||
use Tests\TestCase;
|
||||
|
||||
class GetVersionTest extends TestCase
|
||||
{
|
||||
/** @test */
|
||||
public function it_run_setup_command(): void
|
||||
{
|
||||
config(['monica.app_version' => '1.0.0']);
|
||||
|
||||
$this->artisan('monica:getversion')
|
||||
->expectsOutput('1.0.0')
|
||||
->assertExitCode(0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user