This commit is contained in:
zimoyin
2026-03-13 20:27:18 +08:00
parent 9ddec3dfb9
commit 18254d82f5
9 changed files with 102 additions and 10 deletions
+3 -1
View File
@@ -94,7 +94,9 @@ class BlockTest extends TestCase
$engine = ProcessEngine::createStandard();
$result = $engine->execute($context);
// 输出语音
Logger::info("测试时间验证策略阻断 - 阻断模式开启 success:{}",[$result->isSuccess()]);
Logger::info($result->getFullVoice());
// 阻断模式下,时间不足应该导致流程失败
$this->assertFalse($result->isSuccess(), '阻断模式下,时长不足应失败');
}
+44
View File
@@ -76,6 +76,50 @@ class ManualWashTest extends TestCase
// 验证最终步骤成功
$this->assertTrue($result5->isSuccess(), '干燥步骤 isSuccess() 应为 true');
}
/**
* 测试完整手工洗流程:清洗 -> 漂洗 -> 消毒 -> 终末漂洗 -> 干燥
* 使用真实环境引擎执行
*/
public function testCompleteManualWashProcess2(): void
{
$operator = '操作员 1';
$endoscope = '胃镜 1';
// 步骤 1:清洗
$result1 = $this->processor->swipe($operator, $endoscope, '清洗');
$this->assertSuccess($result1, '清洗步骤应成功');
$this->assertStep($result1, '清洗');
$this->assertNeedDatabaseOperation($result1);
$batchNo = $result1->getBatchNo();
$this->assertNotEmpty($batchNo, '应生成批次号');
// 步骤 2:漂洗
$result2 = $this->processor->swipe($operator, $endoscope, '漂洗');
$this->assertSuccess($result2, '漂洗步骤应成功');
$this->assertStep($result2, '漂洗');
$this->assertBatchNoEquals($result2, $batchNo, '批次号应保持一致');
// 步骤 3:消毒
$result3 = $this->processor->swipe($operator, $endoscope, '消毒');
$this->assertSuccess($result3, '消毒步骤应成功');
$this->assertStep($result3, '消毒');
$this->assertBatchNoEquals($result3, $batchNo, '批次号应保持一致');
// 步骤 4:终末漂洗
$result4 = $this->processor->swipe($operator, $endoscope, '终末漂洗');
$this->assertSuccess($result4, '终末漂洗步骤应成功');
$this->assertStep($result4, '终末漂洗');
$this->assertBatchNoEquals($result4, $batchNo, '批次号应保持一致');
// 步骤 5:干燥
$result5 = $this->processor->swipe($operator, $endoscope, '干燥');
$this->assertSuccess($result5, '干燥步骤应成功');
$this->assertStep($result5, '干燥');
$this->assertBatchNoEquals($result5, $batchNo, '批次号应保持一致');
// 验证最终步骤成功
$this->assertTrue($result5->isSuccess(), '干燥步骤 isSuccess() 应为 true');
}
/**
* 测试使用便捷方法执行完整手工洗流程