[英]expectExceptionMessageRegExp() function is deprecated in phpunit 9 . What's the other alternate function that i can use instead?
將 phpunit 版本從 7.1 切換到 9.5.28 后出現以下問題無法斷言“錯誤”類型的異常與預期的異常“異常”匹配。 expectExceptionMessageRegExp() 已棄用。
expectExceptionMessageRegExp() 已在 PHPUnit 8 中棄用,並將在 PHPUnit 9 中刪除。改用 expectExceptionMessageMatches()。
例子:
function testResponse(){
$this->expectExceptionMessageRegExp("/Unable to emit response/");
}
用。。。來代替:
function testResponse(){
$this->expectExceptionMessageMatches("/Unable to emit response/");
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.