gpt4 book ai didi

php - 无法设置 PHPunit 以在 Windows 上使用 Yii

转载 作者:可可西里 更新时间:2023-11-01 13:47:37 24 4
gpt4 key购买 nike

PHPUnit 适用于其他项目,但当我尝试运行 Yii 测试时,我收到以下警告(即使是空测试):

There was 1 failure:

1) Warning

Warning: include(PHP_Invoker.php): failed to open stream: No such file or directory in C:\Users\pumpkin\Documents\GitHub\arhano\codebase\arhanoii\vendor\yiisoft\yii\framework\YiiBase.php on line 423

Warning: include(): Failed opening 'PHP_Invoker.php' for inclusion (include_path='.;C:\Users\pumpkin\Documents\GitHub\arhano\codebase\arhanoii\componen ts;C:\Users\pumpkin\Documents\GitHub\arhano\codebase\arhanoii\models;C:\xampp\php\PEAR') in C:\Users\pumpkin\Documents\GitHub\arhano\codebase\arhanoii\ vendor\yiisoft\yii\framework\YiiBase.php on line 423

看起来我必须安装 phpunit/PHP_Invoker,但这是不可能的,因为它需要 pcntl PHP 扩展,这在 Win 上不是 avilabe。

你知道如何消除这个警告吗?是否可以在不使用 PHP_Invoker 的情况下在 Windows 上运行 Yii 测试?

最佳答案

这是一个对我有用的解决方案: https://github.com/yiisoft/yii/issues/1907#issuecomment-14519537

引用:

  • went to pear.phpunit.de
  • manually downloaded PHP_Invoker utility class
  • unzipped the file on my daughter's mac (I'm running Windows)
  • put the "Invoker" directory under C:\xampp\php\pear\PHP
  • put the "Invoker.php" file under C:\xampp\php\pear\PHP

我在 Windows 7 机器上,解压缩工作正常。不需要 mac...

测试在任何情况下都运行良好,但现在我没有得到烦人的长“包括(PHP_Invoker.php):无法打开流”每次在测试过程中发生错误时都会发出消息。

关于php - 无法设置 PHPunit 以在 Windows 上使用 Yii,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14032093/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com