Use of undefined constant SIGTERM - gt; assumed #39;SIGTERM#39;(使用未定义的常量 SIGTERM - gt;假定为“SIGTERM)
问题描述
当前在我的 Windows 机器上使用 Codeception 运行 PHPUnit 给我一个错误:
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
是 PCNTL,Windows 不支持.这样,这个 CONSTANT 不应该用于在 Windows 环境上运行的测试.完全没有.
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
推荐答案
问题在于 phiremock-codeception-extension
使用 SIGTERM
而不检查 OS/PCNTL扩展是可用的.所以我在 GitHub https://github.com/mcustiel/创建了一个错误报告phiremock-codeception-extension/issues/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..
这是受感染的代码行 - https://github.com/mcustiel/phiremock-codeception-extension/blob/master/src/Extension/PhiremockProcess.php#L74
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.
此问题已在 phiremock-codeception-extension v.1.2.3.
这篇关于使用未定义的常量 SIGTERM - >假定为“SIGTERM"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用未定义的常量 SIGTERM - >假定为“SIGTERM"


- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 没有作曲家的 PSR4 自动加载 2022-01-01
- 如何定位 php.ini 文件 (xampp) 2022-01-01
- Laravel 仓库 2022-01-01
- 带有通配符的 Laravel 验证器 2021-01-01
- Mod使用GET变量将子域重写为PHP 2021-01-01
- 从 PHP 中的输入表单获取日期 2022-01-01
- SoapClient 设置自定义 HTTP Header 2021-01-01
- PHP Count 布尔数组中真值的数量 2021-01-01
- 正确分离 PHP 中的逻辑/样式 2021-01-01