php - 尝试编写 PHP 单元测试时不推荐使用方法“setMethods”
问题描述
我想创建一个模拟来替换资源:
$gateway = $this->getMockBuilder('PaymentGateway')
->setMethods(['transfer'])
->getMock();
我收到了这个警告:
方法“setMethods”已弃用
如何解决此弃用?
解决方案
推荐阅读
- binding - 我可以只在 Xamarin.Android 绑定库项目中为一个类生成绑定吗?
- css - CSS 中的像素 (px) 是什么(在视网膜显示时)?
- r - R中的字符变量分组
- azure - microsoft/iis - 连接到系统的设备无法运行
- vespa - 在发送到 Vespa 之前,是否应该从文档中删除 ASCII 控制字符?
- java - MetaMap java.lang.OutOfMemoryError:Java 堆空间
- regex - typedef c结构的一个衬里
- python - 是否可以使用 2 种服务器端语言在同一个域中呈现 2 个不同的网页
- python - python子类无法从超类导入超类
- r - 计算沿动物运动路径的点之间的距离和时间