【发布时间】:2017-04-04 16:47:59
【问题描述】:
我想用最新版本的 phpunit 开始对我的 symfony 3 应用程序进行单元测试。我跟着this 教程。但是当我运行这个命令时
phpunit -c
根据官网https://phpunit.de/安装的php单元版本不是最新版本(!= 5.6):
PHPUnit 4.8.17 by Sebastian Bergmann and contributors.
类测试是:
类 CalculatorTest 扩展 \PHPUnit_Framework_TestCase
{
public function testAdd()
{
$calc = new Calculator();
$result = $calc->add(30, 12);
// assert that your calculator added the numbers correctly!
$this->assertEquals(42, $result);
}
}
不知道框架是使用bundle来导入PHPUnit_Framework_TestCase类还是使用我电脑上安装的phpunit? 以及如何更新 phpunit 版本?
【问题讨论】:
-
我的php版本是:5.6.31