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

8 lines
1.4 KiB
PHP

<?php
require __DIR__.'/boot-QA.php';
use Illuminate\Support\Facades\DB;use Illuminate\Support\Facades\Crypt;use Illuminate\Support\Str;
if($target!==['database'=>'public_documents_20261018_test','port'=>55441])throw new RuntimeException('Exact QA fixture guard');
$private='C:/Users/macbook/.config/investmoz/documentos-publicos-QA-20261018';
$actors=[];foreach(['authorized','unprivileged']as$role){$a=$role==='authorized'?App\Models\User::findOrFail(2):(App\Models\User::where('email','qa-public-document-unprivileged@example.test')->first()??new App\Models\User);$password=Str::random(36);$secret='';$alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';for($i=0;$i<32;$i++)$secret.=$alphabet[random_int(0,31)];if(!$a->exists){$a->name='QA passo 4 sem permissão';$a->email='qa-public-document-unprivileged@example.test';}$a->password=$password;$a->email_verified_at=now();$a->two_factor_secret=Crypt::encrypt($secret);$a->two_factor_recovery_codes=Crypt::encrypt('[]');$a->two_factor_confirmed_at=now();$a->save();$actors[$role]=['id'=>$a->id,'email'=>$a->email,'password'=>$password,'secret'=>$secret];}
file_put_contents($private.'/fixture-private.json',json_encode(['url'=>'http://127.0.0.1:18546','database'=>$target['database'],'actors'=>$actors]));echo json_encode(['fixture'=>'isolated existing account 2 and one unprivileged synthetic account','roles_added'=>0,'active_changes'=>0]).PHP_EOL;