?@beforeClass
? 標(biāo)注用于指明此靜態(tài)方法應(yīng)該于測(cè)試類(lèi)中的所有測(cè)試方法都運(yùn)行完成之后調(diào)用,用于建立共享基境(?fixture
?)。
<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
final class MyTest extends TestCase
{
/**
* @beforeClass
*/
public static function setUpSomeSharedFixtures(): void
{
// ...
}
/**
* @beforeClass
*/
public static function setUpSomeOtherSharedFixtures(): void
{
// ...
}
}
更多建議: