Use composer metadata as primary source for version and ping build
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Setting;
|
||||
|
||||
it('returns ping status with build and notification state', function (): void {
|
||||
Setting::updateOrCreate(['key' => 'build'], ['value' => '1337']);
|
||||
$composer = json_decode((string) file_get_contents(base_path('composer.json')), true);
|
||||
$expectedBuild = isset($composer['build']) ? (int) $composer['build'] : null;
|
||||
|
||||
$response = $this->getJson('/ping');
|
||||
|
||||
@@ -11,7 +10,7 @@ it('returns ping status with build and notification state', function (): void {
|
||||
$response->assertJson([
|
||||
'connect' => 'ok',
|
||||
'version_status' => [
|
||||
'build' => 1337,
|
||||
'build' => $expectedBuild,
|
||||
],
|
||||
'notification_state' => false,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user