Skip to content

Commit

Permalink
feat: add monica:getversion command (#6965)
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin authored Oct 29, 2023
1 parent a46e92b commit cd1b699
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
30 changes: 30 additions & 0 deletions app/Console/Commands/GetVersion.php
Original file line number Diff line number Diff line change
@@ -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 changes: 18 additions & 0 deletions tests/Unit/Commands/GetVersionTest.php
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit cd1b699

Please sign in to comment.