symfony 测试目录的声纳配置

sonar configuration for symfony tests directory

我正在寻找一种同时配置多个测试目录的方法。这是我目前的配置

sonar.sources=src

sonar.tests=src/Acme/Bundle/DemoBundle/Tests,src/Acme/Bundle/DatabaseBundle/Tests

sonar.phpUnit.configuration=app/phpunit.xml.dist

sonar.php.tests.reportPath=build/logs/junit.xml
sonar.php.coverage.reportPath=build/logs/clover.xml

sonar.libraries=vendor

sonar.language=php

问题是,有没有办法像

那样为sonar.tests定义路径
src/**/Tests

Sonar 停止并出现以下错误:

 The folder 'src/**/Tests' does not exist for DemoProject

这确实不可能。实现您想要做的事情的最佳方法是使用包含 and/or 排除 - 它接受通配符。

例如:

sonar.tests=src
sonar.test.inclusions=**/Tests/**

您可以在 "Narrowing the focus" documentation page 上了解更多信息。