Files
Investidor-V2/outputs/investmoz-fintech-investimento-QA-20261015/prove-nonmaterial-QA.php
T
nala 6a76aac80f
tests / ci (push) Canceled after 0s
versao compilada 1
2026-10-16 09:17:28 +02:00

5 lines
1.5 KiB
PHP

<?php require __DIR__.'/boot-QA.php';use Illuminate\Support\Facades\DB;
$p=json_decode(file_get_contents(__DIR__.'/CENARIOS-FINAIS-QA.json'),true);$fin=app(App\Services\FintechInvestment::class);$path=app(App\Services\InvestorPath::class);$checks=[];
foreach($p['scenarios']as$s){$actor=App\Models\User::findOrFail($s['user_id']);$view=$path->view($actor,$s['id']);$profile=$view['fintech']['record']['profile'];$record=['profile'=>$profile];$hash=$fin->reviewFingerprints($record);$changed=$record;$changed['profile']['fields']['infrastructure']='';if($hash!==$fin->reviewFingerprints($changed))throw new RuntimeException('Empty optional field changed review scope');$checks[$s['scenario'].'_empty_optional_field_not_material']=true;$profile['operation_countries']=array_reverse($profile['operation_countries']);$version=$view['case']['version'];$events=DB::table('desk_events')->where('case_id',$s['id'])->count();$fin->save($actor,$s['id'],['version'=>$version,'profile'=>$profile]);if($path->view($actor,$s['id'])['case']['version']!==$version||DB::table('desk_events')->where('case_id',$s['id'])->count()!==$events)throw new RuntimeException('Country order replay changed data');$checks[$s['scenario'].'_country_order_replay_no_write']=true;}
file_put_contents(__DIR__.'/PROVA-ALTERACAO-NAO-MATERIAL-QA.json',json_encode(['result'=>'passed','checks'=>$checks,'active_changes'=>0],JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));echo json_encode(['result'=>'passed','checks'=>count($checks)]);