phpunit - Mac OS Mojave phpunit 8.0.1 symfony
问题描述
安装 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
解决方案
您的 tearDown 功能与您扩展的功能不兼容。您必须添加返回类型才能实现相同的声明。
protected function tearDown(): void
另请参阅文档https://phpunit.de/announcements/phpunit-8.html部分“模板方法的返回类型”
推荐阅读
- c++ - DirectX 11 渲染到特定区域
- multithreading - 为什么 xsub 中的静态变量不是线程安全的?
- vba - VBA自动化无法获取innerText(innerHTML,值)
- java - @JoinColumn 注释中的 name 和 referencedColumnName 之间的区别?
- sql - 简单的正则表达式过滤掉前后字符
- android - 使用返回堆栈中的片段刷新活动
- c# - AngularJS 100 以上记录未加载
- javascript - 将输入发送到 Ajax 中的文件
- bayesian - 使用 stan_glmer 进行 beta 回归的 rstanarm 错误
- vb.net - Visual Basic 中的扩展十六进制地址