为什么这个断言在运行phpunit时没有失败?
为什么这不显示phpunit上的错误?当我运行测试时,它不会标记断言错误为什么这个断言在运行phpunit时没有失败?,php,phpunit,Php,Phpunit,为什么这不显示phpunit上的错误?当我运行测试时,它不会标记断言错误 namespace AlaphantTest; use PHPUnit\Framework\TestCase; use Alaphant\Module; class ModuleTest extends TestCase { protected $module; public function setUp(){ $this->module = new Module();
namespace AlaphantTest;
use PHPUnit\Framework\TestCase;
use Alaphant\Module;
class ModuleTest extends TestCase
{
protected $module;
public function setUp(){
$this->module = new Module();
}
public function testIsValid(){
$this->assertTrue(1==2);
}
}
我无法复制这一点:
$ cat Test.php
<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
final class Test extends TestCase
{
public function testOne(): void
{
$this->assertTrue(1 == 2);
}
}
原来是以前的开发人员修改了供应商代码。我把它换掉了,现在可以用了。谢谢
$ php phpunit-8.5.phar Test.php
PHPUnit 8.5.2 by Sebastian Bergmann and contributors.
F 1 / 1 (100%)
Time: 59 ms, Memory: 10.00 MB
There was 1 failure:
1) Test::testOne
Failed asserting that false is true.
/home/sb/Test.php:8
FAILURES!
Tests: 1, Assertions: 1, Failures: 1.