2016-07-08 30 views
5

phpunit.xml'da yapılandırılmış birden çok test paketiniz varsa, birden fazla test paketini nasıl çalıştırıyorsunuz, ancak bunların hepsi komut satırından değil?Komut satırından birden çok PHPUnit test paketi nasıl çalıştırılır?

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> 

örnek

phpunit --testsuite Unit|Integration ancak Acceptance

cevap

4

bunu bekliyoruz gibi çalışmıyor. <pattern> gerçek bir model değildir

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

.

Çalıştırmak için bir test takımı seçebilir, ancak çalışacakları filtrelemek için bir desen kullanamazsınız.

Daha iyi bir açıklama olurdu --testsuite <name> Which testsuite to run.

Sayı raporu https://github.com/sebastianbergmann/phpunit/issues/2273

+4

aslında mesele çözüldü (https://github.com/sebastianbergmann/phpunit/commit/80754cf323fe96003a2567f5e57404fddecff3bf). ve şimdi testsuitleri virgülle ayırarak çalışır: phpunit --testsuite suite1, suite2' – emfi

İlgili konular