我尝试运行测试并得到了这个错误
In Acceptance.php line 97:
curl_setopt(): 文件名不能为空
我的Acceptence.php文件
$imgPath = codecept_output_dir() .'debug/fail.png';
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'chat_id' => $chatID,
'photo' => new \CURLFile(realpath($imgPath))
]); Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
我解决了这个问题,事实是函数"codecept_output_dir()"获取了错误的路径,因此导致了错误。谢谢你的建议和答案)