<?php
require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$kernel->bootstrap();

use Livewire\Livewire;
use App\Filament\Resources\UserResource\Pages\EditUser;
use App\Models\User;

Auth::loginUsingId(1);

try {
    Livewire::actingAs(User::find(1))
        ->test(EditUser::class, ['record' => 3])
        ->set('data.name', 'NAMA BARU IBU')
        ->call('save')
        ->assertHasNoErrors();
    echo "SUCCESS\n";
} catch (\Exception $e) {
    echo "ERROR: " . $e->getMessage() . "\n";
    echo $e->getTraceAsString() . "\n";
}
