使用 prophecy 扩展 php 函数可通过以下步骤实现:使用 composer 安装 prophecy。使用 prophesize() 方法创建桩对象。使用 will() 方法配置桩对象的行为。使用 shouldhavebeencalled() 方法验证桩对象是否已被调用。 如何使用 Pro