国产gaysexchina男同gay,japanrcep老熟妇乱子伦视频,吃奶呻吟打开双腿做受动态图,成人色网站,国产av一区二区三区最新精品

PHPUnit9.0 標(biāo)注-@testWith

2022-03-24 11:01 更新
PHPUnit9.0 標(biāo)注集合PHPUnit9.0 標(biāo)注集合

除了實(shí)現(xiàn)一個(gè)方法并將之與 ?@dataProvider? 聯(lián)用外,你也可以用 ?@testWith? 標(biāo)注來(lái)定義數(shù)據(jù)集。

數(shù)據(jù)集由一個(gè)或多個(gè)元素組成。要定義具有多個(gè)元素的數(shù)據(jù)集,每個(gè)元素都要定義在單獨(dú)一行中。數(shù)據(jù)集的每個(gè)元素都必須是以 JSON 格式定義的數(shù)組。

/**
 * @testWith ["test", 4]
 *           ["longer-string", 13]
 */
public function testStringLength(string $input, int $expectedLength): void
{
    $this->assertSame($expectedLength, strlen($input));
}

以 JSON 格式表示的對(duì)象會(huì)轉(zhuǎn)換為關(guān)聯(lián)數(shù)組。

/**
 * @testWith [{"day": "monday", "conditions": "sunny"}, ["day", "conditions"]]
 */
public function testArrayKeys(array $array, array $keys): void
{
    $this->assertSame($keys, array_keys($array));
}


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)