Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Phpunit 解释PHP单元输出_Phpunit - Fatal编程技术网

Phpunit 解释PHP单元输出

Phpunit 解释PHP单元输出,phpunit,Phpunit,我的PHP单元在控制台上输出这个。63/129(48%)的确切含义是什么?它是否运行所有测试 PHPUnit 3.7.22 by Sebastian Bergmann. Configuration read from phpunit.xml ............................................................... 63 / 129 ( 48%) ..............................................

我的PHP单元在控制台上输出这个。
63/129(48%)
的确切含义是什么?它是否运行所有测试

PHPUnit 3.7.22 by Sebastian Bergmann.

Configuration read from phpunit.xml

...............................................................  63 / 129 ( 48%)
............................................................... 126 / 129 ( 97%)
...

Time: 0 seconds, Memory: 6.75Mb

OK (129 tests, 245 assertions)
phpunit.xml如下所示:

<?xml version="1.0" encoding="utf-8" ?>
<phpunit bootstrap="vendor/autoload.php">

    <testsuites>
        <testsuite name="SDK Testsuite">
            <directory suffix="Test.php">src/MyNamespace/Test/Unit</directory>
        </testsuite>
    </testsuites>

</phpunit>

src/MyNamespace/Test/Unit

每个点代表一个单元测试。它在运行每个测试后打印一个点。第一行有63个点,这意味着129个测试中有63个(约48%)已经运行。第二行还有63个点,总共有126个测试。最后三次测试在第三行


该功能适用于测试需要很长时间的情况,您可以在屏幕上跟踪进度。如果其中一个测试使系统陷入死锁,它也很有用。进度表可以让您看到哪个是有问题的测试。

每个点代表一个成功完成的测试。其他输出符号包括‘I’、‘S’、‘R’、‘F’和‘E’

当测试包括线路时,产生“I”

$this->markTestIncomplete('Your reason for being incomplete string');
$this->markTestSkipped('Your reason for skipping string');
当测试包括线路时,产生“S”

$this->markTestIncomplete('Your reason for being incomplete string');
$this->markTestSkipped('Your reason for skipping string');
当测试以某种方式存在风险,即不执行任何断言时,会生成“R”

当phpunit在测试执行过程中遇到错误时,将生成“E”,当正在执行的测试中的断言失败时,将生成“F”