Files
Investidor-V2/outputs/investmoz-editorial-QA-20261018/history-QA.php
T
nala cf003c8623
tests / ci (push) Canceled after 0s
versao nrgocios 4
2026-10-18 15:57:06 +02:00

8 lines
910 B
PHP

<?php
require __DIR__.'/boot-QA.php';
use Illuminate\Support\Facades\DB;
$r=DB::table('portal_resources')->find(30);$document=DB::table('documents')->find($r->document_id);$versions=DB::table('portal_resource_revisions')->where('resource_id',30)->get();$bodies=[];$actors=[];
foreach($versions as $v){$s=json_decode($v->snapshot,true);$c=$s['resource']['editorial_content']??null;if(is_string($c))$c=json_decode($c,true);if(is_array($c)){$bodies[]=$c['body'];$actors[]=(int)$v->actor_user_id;}}
$path=Illuminate\Support\Facades\Storage::disk('local')->path($document->storage_key);
echo json_encode(['resource_id'=>30,'previous_bodies'=>count(array_unique($bodies)),'revisions'=>count($versions),'actor_consistent'=>count(array_unique($actors))===1&&($actors[0]??null)===2,'original_unchanged'=>hash_file('sha256',$path)===trim($document->sha256),'relations_present_in_snapshots'=>isset($s['associations'])]);