commit de compras
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
use Illuminate\Support\Facades\DB;
|
||||
$s=json_decode(file_get_contents(getenv('RECEIPT_COMPOSITION_STATE')),true);$out=$s['root'].'/supplier-search-guard.json';if(!($s['supplierSearch']??false)||is_file($out))throw new LogicException('Isolated selector fixture required');require $s['app'].'/vendor/autoload.php';$app=require $s['app'].'/bootstrap/app.php';$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();$queries=0;DB::listen(function()use(&$queries){$queries++;});$checks=[];
|
||||
config(['receipt_qa.sourcing_enabled'=>false]);try{(new App\Modules\Purchasing\SourcingController)->suppliers(1,new Illuminate\Http\Request,new App\Modules\Purchasing\ReceiptRuntime);throw new RuntimeException('Disabled lookup accepted');}catch(Symfony\Component\HttpKernel\Exception\HttpException $e){if($e->getStatusCode()!==404)throw $e;}$checks[]='disabled supplier lookup refuses before SQL';
|
||||
config(['receipt_qa.sourcing_enabled'=>true]);$app->instance('env','production');try{(new App\Modules\Purchasing\SourcingController)->suppliers(1,new Illuminate\Http\Request,new App\Modules\Purchasing\ReceiptRuntime);throw new RuntimeException('Production accepted');}catch(Symfony\Component\HttpKernel\Exception\HttpException $e){if($e->getStatusCode()!==403)throw $e;}$checks[]='production refuses synthetic selector before SQL';
|
||||
if($queries!==0||App\Shared\Context\ModuleNavigation::owner('api/purchasing-sourcing/requests/1/suppliers')!=='purchasing')throw new RuntimeException('Guard boundary');$checks[]='lookup belongs to purchasing and guard probes issue zero SQL';file_put_contents($out,json_encode(['passed'=>true,'checks'=>$checks,'database_queries'=>0],JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));echo count($checks)." supplier lookup guards passed.\n";
|
||||
Reference in New Issue
Block a user