3 lines
1.8 KiB
PHP
3 lines
1.8 KiB
PHP
<?php
|
|
require __DIR__.'/sgf-hr-personnel-proof-bootstrap.php';$c=json_decode(file_get_contents($s['root'].'/hp-concurrency-1794380380400/cuts.json'),true);$n=$host->table('hp_versions')->count();$cmd=$host->table('hp_commands')->count();$host->beginTransaction();try{$in=$hpInput('leave',$c['b_key'],1,['decision'=>'refused'],'review');$p=$hpPreview(14,$in);$ok($p['impact']['after']['state']==='refused'&&$p['impact']['after']['effective']===null,'new explicit refusal conference allowed on obsolete insufficient proposal');$ok($p['impact']['after']['proposal']['refusal_conference']['current_balance']['available_minutes']===0,'refusal preview shows actual insufficient balance');$ok($p['impact']['after']['proposal']['refusal_conference']['original_source_changed'],'source changes shown in refusal impact');[$out,$cut]=$hpCommand(14,$in);$ok($out['state']==='refused'&&$out['version']===2&&$out['impact']['after']['effective']===null,'distinct refusal applies no reservation');$again=$hpConfirm(14,$cut['preview']);$ok($again['replayed']&&$again['id']===$out['id'],'refusal replay no duplication');$select(17);$list=$hp->listing($hrActor(17),['kind'=>'entitlement']);$ok($list['records']['data'][0]['current_balance']['available_minutes']===0&&$list['records']['data'][0]['current_balance']['reserved_minutes']===480,'refusal preserves first reservation and available balance');}finally{$host->rollBack();}$ok($host->table('hp_versions')->count()===$n&&$host->table('hp_commands')->count()===$cmd,'refusal recovery test fully reverted');file_put_contents($work.'/hp-refusal.json',json_encode(['passed'=>true,'checks'=>$checks,'all_fixtures_rolled_back'=>true,'regression_only'=>true],JSON_PRETTY_PRINT));echo json_encode(['passed'=>true,'checks'=>count($checks),'proof'=>$work.'/hp-refusal.json']).PHP_EOL;
|