W3Cschool
恭喜您成為首批注冊(cè)用戶(hù)
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
PHPUnit的 XML 配置文件(Appendix?C, XML 配置文件)也可以用于編排測(cè)試套件。Example?5.1, “用 XML 配置來(lái)編排測(cè)試套件”展示了一個(gè)最小化的 phpunit.xml
例子,它將在遞歸遍歷 tests
時(shí)添加所有在 *Test.php
文件中找到的 *Test
類(lèi)。
Example?5.1.?用 XML 配置來(lái)編排測(cè)試套件
<phpunit bootstrap="src/autoload.php">
<testsuites>
<testsuite name="money">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
如果 phpunit.xml
或 phpunit.xml.dist
(按此順序)存在于當(dāng)前工作目錄并且未使用 --configuration
,將自動(dòng)從此文件中讀取配置。
可以明確指定測(cè)試的執(zhí)行順序:
Example?5.2.?用 XML 配置來(lái)編排測(cè)試套件
<phpunit bootstrap="src/autoload.php">
<testsuites>
<testsuite name="money">
<file>tests/IntlFormatterTest.php</file>
<file>tests/MoneyTest.php</file>
<file>tests/CurrencyTest.php</file>
</testsuite>
</testsuites>
</phpunit>
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話(huà):173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: