toBe($outcome); })->with('permissionsDataProvider'); test('check', function () { // user_id is supplied so the factory does not resolve its User relationship, // which Laravel expands by persisting the parent even under make(). $model = ApiKey::factory()->make(['user_id' => 1, 'r_servers' => AdminAcl::READ | AdminAcl::WRITE]); expect(AdminAcl::check($model, AdminAcl::RESOURCE_SERVERS, AdminAcl::WRITE))->toBeTrue(); });