亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么 PHPUnit 9 不期望記錄 phpunit.xml.dist 的 log 子元素

為什么 PHPUnit 9 不期望記錄 phpunit.xml.dist 的 log 子元素

PHP
弒天下 2023-10-21 15:56:37
我正在致力于將 PHP 應用程序(超過 10 年)過渡到 PHP 7.4,我們目前正在應用程序的 PHP 7.4 分支上實現持續集成。我們決定使用 PHP 當前穩定版本支持的 PHPUnit 版本。因此我們將 PHP 7.4 分支的 ci 測試工作升級到了 PHPUnit 9.3。我們根據文檔進行了所有必要的更改,但我們因一個不知道如何修復的警告而被阻止(假設執行了測試并且在正確的位置發布了報告)  Warning - The configuration file did not pass validation!  The following problems have been detected:  Line 38:  - Element 'log': This element is not expected..我在下面分享我們的 PHPUnit 配置以及我們用來啟動它的命令,有人能發現它有什么問題嗎?phpunit -c phpunit.xml.dist<?xml version="1.0" encoding="UTF-8"?><phpunit    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.3/phpunit.xsd"    colors="true"    bootstrap="tests/bootstrap.php">    <testsuites>        <testsuite name="Unit Tests">            <directory>tests/</directory>        </testsuite>    </testsuites>    <coverage>        <include>            <directory suffix=".php">api</directory>        </include>    </coverage>    <logging>        <log type="junit" target="build/unit_report.xml"/>    </logging></phpunit>
查看完整描述

2 回答

?
慕尼黑5688855

TA貢獻1848條經驗 獲得超2個贊

<log>元素在 PHPUnit 9.3 中也發生了變化。

你需要改變


<logging>

? <log type="junit" target="build/unit_report.xml"/>

</logging>


<logging>

? <junit outputFile="build/unit_report.xml"/>

</logging>

話雖這么說,我強烈建議使用 PHPUnit 的--migrate-configurationCLI 選項自動將您的配置文件轉換為新格式。


查看完整回答
反對 回復 2023-10-21
?
慕田峪7331174

TA貢獻1828條經驗 獲得超13個贊

PHPUnit 9.5.x 中已更改


嘗試以下任何一個


<logging>

? ? <testdoxHtml outputFile="tests/coverage.html"/>

? ? <testdoxXml outputFile="tests/coverage.xml"/>

? ? <text outputFile="tests/coverage.txt"/>

</logging>


查看完整回答
反對 回復 2023-10-21
  • 2 回答
  • 0 關注
  • 185 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號