create(); $this->actingAs(User::factory()->create(['tenant_id' => $tenant->id])); $this->postJson('/api/tenant/requisites/lookup-inn', ['inn' => '7707083893']) ->assertOk() ->assertJson(['found' => false]); }); it('lookup-inn returns found:true with a fake lookup', function () { $tenant = Tenant::factory()->create(); $this->actingAs(User::factory()->create(['tenant_id' => $tenant->id])); $this->app->bind(PartyLookup::class, fn () => new class implements PartyLookup { public function findByInn(string $inn): ?PartyLookupResult { return new PartyLookupResult('ООО Тест', '770101001', '1027700132195', 'Москва', 'LEGAL', []); } }); $this->postJson('/api/tenant/requisites/lookup-inn', ['inn' => '7707083893']) ->assertOk() ->assertJson([ 'found' => true, 'legal_name' => 'ООО Тест', 'subject_type_hint' => 'legal_entity', ]); });