我正在编写依赖于外部类exceptionManager的单元测试。我希望能够预测此类中的一些特定函数将返回什么,所以我使用了一个模拟对象。代码非常简单:$mockExceptionManager=$this->getMock('exceptionManager');问题是,我的异常管理器实现了IteratorAggregate接口(interface),它需要一个如下所示的方法:publicfunctiongetIterator(){returnnewArrayIterator($this->exceptions);}当我运行单元测试时,出现以下错误:Fatalerror:Cannot