更新
This commit is contained in:
@@ -136,6 +136,18 @@ $trackingWindowMethod = diagnosisWorkspaceMethodSource(
|
||||
$trackingWindowControllerMethod = diagnosisWorkspaceMethodSource(
|
||||
(new ReflectionClass(DiagnosisController::class))->getMethod('trackingWindow')
|
||||
);
|
||||
$imChatControllerMethod = diagnosisWorkspaceMethodSource(
|
||||
(new ReflectionClass(DiagnosisController::class))->getMethod('getImChatMessages')
|
||||
);
|
||||
$imChatSyncControllerMethod = diagnosisWorkspaceMethodSource(
|
||||
(new ReflectionClass(DiagnosisController::class))->getMethod('triggerImChatSync')
|
||||
);
|
||||
$imChatLogicMethod = diagnosisWorkspaceMethodSource(
|
||||
(new ReflectionClass(DiagnosisLogic::class))->getMethod('getImChatMessagesForDiagnosis')
|
||||
);
|
||||
$imChatOwnerMethod = diagnosisWorkspaceMethodSource(
|
||||
(new ReflectionClass(DiagnosisLogic::class))->getMethod('attachDiagnosisIdToImMessages')
|
||||
);
|
||||
$doctorNotesControllerMethod = diagnosisWorkspaceMethodSource(
|
||||
(new ReflectionClass(AppointmentController::class))->getMethod('doctorNotes')
|
||||
);
|
||||
@@ -195,6 +207,23 @@ diagnosisWorkspaceAuthExpect(
|
||||
< strpos($trackingWindowMethod, "'blood_records'"),
|
||||
'trackingWindow returns the authorized diagnosis id at the response top level'
|
||||
);
|
||||
diagnosisWorkspaceAuthExpect(
|
||||
str_contains($imChatControllerMethod, 'DiagnosisLogic::canViewReadonlyDiagnosis(')
|
||||
&& strpos($imChatControllerMethod, 'DiagnosisLogic::canViewReadonlyDiagnosis(')
|
||||
< strpos($imChatControllerMethod, 'DiagnosisLogic::getImChatMessagesForDiagnosis('),
|
||||
'IM history authorizes the diagnosis before reading patient messages'
|
||||
);
|
||||
diagnosisWorkspaceAuthExpect(
|
||||
str_contains($imChatSyncControllerMethod, 'DiagnosisLogic::canViewReadonlyDiagnosis(')
|
||||
&& strpos($imChatSyncControllerMethod, 'DiagnosisLogic::canViewReadonlyDiagnosis(')
|
||||
< strpos($imChatSyncControllerMethod, 'register_shutdown_function('),
|
||||
'IM archive sync authorizes the diagnosis before queuing background work'
|
||||
);
|
||||
diagnosisWorkspaceAuthExpect(
|
||||
substr_count($imChatLogicMethod, 'attachDiagnosisIdToImMessages(') >= 3
|
||||
&& str_contains($imChatOwnerMethod, "\$row['diagnosis_id'] = \$diagnosisId"),
|
||||
'every IM response row declares its parent diagnosis for client-side ownership checks'
|
||||
);
|
||||
diagnosisWorkspaceAuthExpect(
|
||||
str_contains($doctorNotesControllerMethod, 'DiagnosisLogic::canViewReadonlyDiagnosis(')
|
||||
&& strpos($doctorNotesControllerMethod, 'DiagnosisLogic::canViewReadonlyDiagnosis(')
|
||||
|
||||
Reference in New Issue
Block a user