我知道在评估之前定义所有变量并检查数组索引是最佳实践。但是,我正在尝试对在一些尚未以这种方式编码的遗留代码之上开发的新功能进行一些测试。
Behat 失败并显示此消息:
Scenario: Add a new resource # features/accounting.feature:6
Given I am user "admin" # FeatureContext::iAmUser()
Notice: Undefined index: 13 in classloader.php line 126
When I create a new resource # FeatureContext::iCreateANewResource()
Then [...]
我最终会修复这些通知,但我需要 Behat 暂时忽略来自 PHP 的通知。有没有办法做到这一点?
谢谢!