feat: add monica:getversion command (#6965)

This commit is contained in:
Alexis Saettler
2023-10-29 16:28:53 +01:00
committed by GitHub
parent a46e92b699
commit cd1b69995c
2 changed files with 48 additions and 0 deletions
+30
View File
@@ -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'));
}
}
+18
View File
@@ -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);
}
}