Copy & Paste Engineer

【PHPUnit】PHPUnit This element is not expected..

【PHPUnit】PHPUnit This element is not expected..

PHPUnit を実行すると以下のようなエラーが出る。

  The following problems have been detected:

  Line 38:p
  - Element 'log': This element is not expected..

原因

原因は PHPUnit9.3 の場合、log の記載方法が変わった。 phpunit/ChangeLog-9.3

対処

エラーが出る以下の書き方を変更。

<logging>
  <log type="junit" target="logs/test/report.xml"/>
</logging>

↓ 以下のように変更する。

<logging>
  <junit outputFile="logs/test/report.xml"/>
</logging>

参考情報