【问题标题】:Scrutinizer and specific test from phpunit来自 phpunit 的审查员和特定测试
【发布时间】:2018-11-28 23:22:11
【问题描述】:

我有这个 phpunit.xml 文件:

<phpunit>
  <testsuites>
    <testsuite name="domoticz-api">
      <directory suffix="Test.php">tests</directory>
    </testsuite>
    <testsuite name="scrutinizer">
        <file>tests/Domoticzapi4Scrutinizer/ClientTest.php</file>
    </testsuite>
  </testsuites>
</phpunit>

按照这个答案:How to run a specific phpunit xml testsuite? 在我的服务器中我可以做到:

./vendor/bin/phpunit --configuration phpunit.xml --testsuite scrutinizer

进行测试。其他测试(主要测试)有几个原因我想从审查员中排除。

所以,在审查器的配置文件中,我有:

build:
    nodes:
        analysis:
            project_setup:
                override:
                    - 'true'
            tests:
                override:
                    - php-scrutinizer-run
                    - command: 'php ./vendor/bin/phpunit --configuration phpunit.xml --testsuite scrutinizer'

        tests: true

coding_style:
    php:
        indentation:
            general:
                use_tabs: true

但不幸的是,Scrutinizer 尝试执行失败的第一组测试 (domoticz-api)。

我也尝试过不使用单引号,配置已验证但 Scrutinizer 执行第一组。

非常感谢。

【问题讨论】:

    标签: php phpunit scrutinizer


    【解决方案1】:

    我正在为某个人发布分析器...

    经过一些尝试和错误,我得到了解决方案:

    build:
        nodes:
            analysis:
                project_setup:
                    override:
                        - 'true'
                tests:
                    override:
                        - php ./vendor/bin/phpunit --configuration phpunit.xml --testsuite scrutinizer
    
    coding_style:
        php:
            indentation:
                general:
                    use_tabs: true
    

    一个简单的命令覆盖并删除“测试:真”。不知道是否还删除了报价影响。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-02
      • 2013-11-08
      • 2014-01-31
      • 1970-01-01
      • 1970-01-01
      • 2010-09-05
      • 1970-01-01
      相关资源
      最近更新 更多