PHPUnit9.0 标注-@codeCoverageIgnore*

2022-03-24 10:58 更新
PHPUnit9.0 标注集合PHPUnit9.0 标注集合

@codeCoverageIgnore​、​@codeCoverageIgnoreStart​ 和 ​@codeCoverageIgnoreEnd​ 标注用于从覆盖率分析中排除掉某些代码行。

<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;

/**
 * @codeCoverageIgnore
 */
final class Foo
{
    public function bar(): void
    {
    }
}

final class Bar
{
    /**
     * @codeCoverageIgnore
     */
    public function foo(): void
    {
    }
}

if (false) {
    // @codeCoverageIgnoreStart
    print '*';
    // @codeCoverageIgnoreEnd
}

exit; // @codeCoverageIgnore


以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号