16 lines
632 B
PHP
16 lines
632 B
PHP
<?php
|
|
|
|
it('reads machine allowed state from session summary payload safely', function (): void {
|
|
$washFlow = file_get_contents(app_path('modules/selfserve/classes/selfserve_wash_flow.php'));
|
|
|
|
expect($washFlow)->not->toBeFalse();
|
|
|
|
$methodOffset = strpos($washFlow, 'public function isMachineAllowedToStartWash');
|
|
expect($methodOffset)->not->toBeFalse();
|
|
|
|
$methodBody = substr($washFlow, (int)$methodOffset, 300);
|
|
expect($methodBody)->toContain("return (\$sessionSummary['session']['allowed'] ?? false) === true;");
|
|
expect($methodBody)->not->toContain("return \$sessionSummary['allowed'] === true;");
|
|
});
|
|
|