2016-07-08 28 views
5

Se sono state configurate più suite di test in phpunit.xml, come si esegue più di una suite di test ma non tutte dalla serie di comandi?Come eseguire più suite di test PHPUnit dalla riga di comando?

phpunit.xml

<?xml version="1.0" encoding="utf-8"?> 
<phpunit 
    backupGlobals="false" 
    backupStaticAttributes="false" 
    colors="true" 
    convertErrorsToExceptions="true" 
    convertNoticesToExceptions="true" 
    convertWarningsToExceptions="true" 
    processIsolation="false" 
    stopOnFailure="true" 
    syntaxCheck="true" 
    bootstrap="tests/bootstrap.php"> 
     <testsuites> 
      <testsuite name="Unit"> 
       <directory suffix="Test.php">tests/unit</directory> 
      </testsuite> 
      <testsuite name="Integration"> 
       <directory suffix="Test.php">tests/integration</directory> 
      </testsuite> 
      <testsuite name="Acceptance"> 
       <directory suffix="Test.php">tests/acceptance</directory> 
      </testsuite> 
     </testsuites> 
     <logging> 
      <log type="coverage-html" target="build/coverage"/> 
      <log type="testdox-html" target="build/requirements.html"/> 
     </logging> 
     <filter> 
      <whitelist> 
       <directory suffix=".php">src</directory> 
      </whitelist> 
     </filter> 
</phpunit> 

esempio

phpunit --testsuite Unit|Integration ma non Acceptance

risposta

4

Non funziona come ci si aspetta a.

--testsuite <pattern> Filter which testsuite to run.

Dove <pattern> non è un andamento reale.

È possibile scegliere una suite di test da eseguire ma non è possibile utilizzare un modello per filtrare quelli da eseguire.

Una descrizione migliore sarebbe --testsuite <name> Which testsuite to run.

Segnalazione https://github.com/sebastianbergmann/phpunit/issues/2273

+4

in realtà il problema è stato risolto (https://github.com/sebastianbergmann/phpunit/commit/80754cf323fe96003a2567f5e57404fddecff3bf). e ora funziona separando i test con la virgola: 'phpunit --testsuite suite1, suite2' – emfi