使用未定义的常量SIGTERM->假设为"SIGTERM" [英] Use of undefined constant SIGTERM - > assumed 'SIGTERM'
问题描述
当前在Windows计算机上运行 PHPUnit 和 Codeception 时,出现错误:
Currently running PHPUnit with Codeception on my Windows machine gives me an error:
[PHPUnit_Framework_Exception]
使用未定义的常量SIGTERM- 假定为"SIGTERM"
[PHPUnit_Framework_Exception]
Use of undefined constant SIGTERM - assumed 'SIGTERM'
据我所知,SIGTERM
是由
As far as I know is that SIGTERM
is a constant provided by PCNTL, which is not supported in Windows. In that way this CONSTANT shouldnt be used for a test running on Windows env. at all.
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
PHPUnit
PHPUnit 5.7.15
密码接收
Codeception PHP Testing Framework v2.2.9
phiremock-codeception-extension
phiremock-codeception-extension v1.2.2
推荐答案
问题取决于使用SIGTERM
的phiremock-codeception-extension
而不检查OS/PCNTL扩展是否可用.因此,我在GitHub https://github.com/mcustiel/phiremock-codeception-extension/问题/4 ..
The problem is depending on phiremock-codeception-extension
which uses SIGTERM
without checking the OS/PCNTL extension is available. So I created a Bug report at GitHub https://github.com/mcustiel/phiremock-codeception-extension/issues/4..
This are the infected code lines - https://github.com/mcustiel/phiremock-codeception-extension/blob/master/src/Extension/PhiremockProcess.php#L74
/**
* Stops the process.
*/
public function stop()
{
$this->process->signal(SIGTERM);
$this->process->stop(3, SIGKILL);
}
开发人员解决问题后,我将更新此答案.
I will update this answer once the problem has been fixed by the developer.
此问题已在.
This issue has beend fixed in phiremock-codeception-extension v.1.2.3.
这篇关于使用未定义的常量SIGTERM->假设为"SIGTERM"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!