当前在我的 Windows 机器上使用 Codeception 运行 PHPUnit 时出现错误:
[PHPUnit_Framework_Exception]
Use of undefined constant SIGTERM - assumed 'SIGTERM'
据我所知,SIGTERM
是由PCNTL 提供的常量。 ,这在 Windows 中不受支持。这样,这个 CONSTANT 不应该用于在 Windows env 上运行的测试。完全没有。
我的 PHP 设置:
PHP 5.6.17 (cli) (built: Jan 6 2016 13:28:38)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
PHP单元
PHPUnit 5.7.15
代码接收
Codeception PHP Testing Framework v2.2.9
phiremock-codeception-extension
phiremock-codeception-extension v1.2.2
最佳答案
问题取决于 phiremock-codeception-extension
,它使用 SIGTERM
而不检查 OS/PCNTL 扩展是否可用。所以我在 GitHub 上创建了一个错误报告 https://github.com/mcustiel/phiremock-codeception-extension/issues/4 ..
/**
* Stops the process.
*/
public function stop()
{
$this->process->signal(SIGTERM);
$this->process->stop(3, SIGKILL);
}
一旦开发人员解决了问题,我将更新此答案。
更新
此问题已在 phiremock-codeception-extension v.1.2.3 中修复.
关于php - 使用未定义常量 SIGTERM -> 假定为 'SIGTERM',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42575136/