【问题标题】:PhpStorm 2018.2, PHPUnit 5.7.27. Process finished with exit code 255PhpStorm 2018.2,PHPUnit 5.7.27。进程以退出代码 255 结束
【发布时间】:2018-09-26 16:17:30
【问题描述】:

使用 Laravel 5.3、PHP 5.6 并尝试测试包的类。

这是我的测试课

class OrderQuoteStrategyTest extends TestCase {

    public function testCanSendQuote() {
        $order=$this->createOrder();
        $orderSpec=new Orderspec();

        $this->expectException( \Exception::class);
        $this->expectExceptionMessage( 'Order must be waiting for Quote');

        $orderQuoteStrategy= new OrderQuoteStrategy();
        $orderQuoteStrategy->canSendQuote( $order, $orderSpec );
    }
}

右键单击并“运行 OrderQuoteStrategyTest (PHPUnit)”时,出现以下错误。

Process finished with exit code 255

【问题讨论】:

    标签: php laravel phpstorm


    【解决方案1】:

    我不得不发布这种问答风格来帮助遇到我这种情况的其他人。

    关于检查 php_error_log:

     PHP Parse error:  syntax error, unexpected ':', expecting ';' or '{' in \vendor\doctrine\instantiator\src\Doctrine\Instantiator\Instantiator.php on line 95
    

    似乎作曲家已将 'doctrine/instantiator' 更新为仅与 PHP 7 兼容的最新版本。

    对于解决方案,将此添加到 require-dev :

      "doctrine/instantiator": "1.0.5"
    

    并运行作曲家更新。

    再次运行上述测试没有错误。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-01-04
      • 2017-11-03
      • 2017-01-19
      • 2020-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多