<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Config;

use function Pest\Laravel\getJson;

test('confirm config loaded', function (): void {
    expect(config('laravel-tools.monitoring'))
        ->toBe([
            'packages' => [
                'laravel/framework',
                'laravel/nova',
            ],
            'composer' => [
                'bin' => 'composer',
                'home' => null,
            ],
        ]);
});

test('expect exception when malformed config', function (): void {
    Config::set('laravel-tools.monitoring.packages');

    getJson('/api/tricks/monitoring')
        ->assertInternalServerError();
});
