【问题标题】:Mac OS Mojave phpunit 8.0.1 symfonyMac OS Mojave phpunit 8.0.1 symfony
【发布时间】:2019-02-04 23:19:54
【问题描述】:

安装 PHPunit 8.0.1 后出现此错误:

Fatal error: Declaration of Symfony\Bundle\FrameworkBundle\Test\KernelTestCase::tearDown() must be compatible with PHPUnit\Framework\TestCase::tearDown()

我正在使用 PHP 7.2

【问题讨论】:

    标签: phpunit php-7.2


    【解决方案1】:

    您的 tearDown 函数与您扩展的函数不兼容。 您必须添加返回类型才能实现相同的声明。

    protected function tearDown(): void
    

    另见文档https://phpunit.de/announcements/phpunit-8.html“模板方法的返回类型”部分

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-10
      • 2019-04-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-17
      • 2019-05-30
      • 2019-04-06
      • 2019-05-21
      相关资源
      最近更新 更多