Harden published curriculum and student flows
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
// Pure local validation only; no database, network, writes, or AI calls.
|
||||
require_once dirname(__DIR__) . '/app/Services/VideoReviewReportValidator.php';
|
||||
|
||||
use App\Services\VideoReviewReportValidator;
|
||||
|
||||
$good = [
|
||||
'missing_inputs' => [], 'issues' => [],
|
||||
'coverage' => [
|
||||
'truncated' => false, 'unprocessed_intervals' => [],
|
||||
'section_results' => [['status'=>'covered','evidence_refs'=>['segment-1']]],
|
||||
'objective_results' => [['status'=>'covered','evidence_refs'=>['segment-1']]],
|
||||
],
|
||||
];
|
||||
$cases = [
|
||||
[$good, true],
|
||||
[array_replace($good, ['missing_inputs'=>['transcript']]), false],
|
||||
[array_replace_recursive($good, ['coverage'=>['truncated'=>true]]), false],
|
||||
[array_replace_recursive($good, ['coverage'=>['unprocessed_intervals'=>[[0,5]]]]), false],
|
||||
[array_replace_recursive($good, ['coverage'=>['section_results'=>[['status'=>'missing']]]]), false],
|
||||
[array_replace($good, ['issues'=>[['severity'=>'major','resolution_status'=>'open']]]), false],
|
||||
[array_replace($good, ['issues'=>[['severity'=>'critical','resolution_status'=>'resolved']]]), false],
|
||||
[array_replace($good, ['issues'=>[['severity'=>'critical','resolution_status'=>'resolved','resolution_evidence'=>'reviewer-note-1']]]), true],
|
||||
];
|
||||
foreach ($cases as $index => [$report, $expected]) {
|
||||
if (VideoReviewReportValidator::approvable($report) !== $expected) {
|
||||
throw new RuntimeException("Report case {$index} failed");
|
||||
}
|
||||
}
|
||||
echo 'PASS ' . count($cases) . " video review report cases\n";
|
||||
Reference in New Issue
Block a user