File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace App \Console \Commands ;
4
+
5
+ use Illuminate \Console \Command ;
6
+
7
+ class GetVersion extends Command
8
+ {
9
+ /**
10
+ * The name and signature of the console command.
11
+ *
12
+ * @var string
13
+ */
14
+ protected $ signature = 'monica:getversion ' ;
15
+
16
+ /**
17
+ * The console command description.
18
+ *
19
+ * @var string
20
+ */
21
+ protected $ description = 'Get current version of monica ' ;
22
+
23
+ /**
24
+ * Execute the console command.
25
+ */
26
+ public function handle (): void
27
+ {
28
+ $ this ->line (config ('monica.app_version ' ));
29
+ }
30
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Tests \Unit \Commands ;
4
+
5
+ use Tests \TestCase ;
6
+
7
+ class GetVersionTest extends TestCase
8
+ {
9
+ /** @test */
10
+ public function it_run_setup_command (): void
11
+ {
12
+ config (['monica.app_version ' => '1.0.0 ' ]);
13
+
14
+ $ this ->artisan ('monica:getversion ' )
15
+ ->expectsOutput ('1.0.0 ' )
16
+ ->assertExitCode (0 );
17
+ }
18
+ }
You can’t perform that action at this time.
0 commit comments