<?php

use App\Models\ManagedEnvironment;
use Illuminate\Foundation\Testing\RefreshDatabase;

uses(RefreshDatabase::class);
it('finds tenant by guid without casting to bigint', function () {
    $tenant = ManagedEnvironment::create([
        'managed_environment_id' => 'b0091e5d-944f-4a34-bcd9-12cbfb7b75cf',
        'name' => 'Test ManagedEnvironment',
    ]);

    $found = ManagedEnvironment::query()->forTenant('b0091e5d-944f-4a34-bcd9-12cbfb7b75cf')->first();

    expect($found)->not->toBeNull();
    expect($found->id)->toBe($tenant->id);
});
