2017-06-14 4 views
0

私は常に次の形式で結果を得ているPHPのphpunit.pharを実行する場合:私はhttps://phpunit.de/manual/3.7/en/textui.htmlに記載されている複数のコマンドラインオプションを使用しようとしてきた、PHPUnitがオブジェクト

PHPUnit 4.8.10 by Sebastian Bergmann and contributors. 
Warning:    The Xdebug extension is not loaded 
           No code coverage will be generated. 

{ 
    "event": "suiteStart", 
    "suite": "CodeIgniter Application Test Suite", 
    "tests": 3 
}{ 
    "event": "suiteStart", 
    "suite": "Welcome_test", 
    "tests": 3 
}{ 
    "event": "testStart", 
    "suite": "Welcome_test", 
    "test": "Welcome_test::test_index" 
}{ 
    "event": "test", 
    "suite": "Welcome_test", 
    "test": "Welcome_test::test_index", 
    "status": "pass", 
    "time": 0.020705938339233, 
    "trace": [], 
    "message": "", 
    "output": "" 
}.{ 
    "event": "testStart", 
    "suite": "Welcome_test", 
    "test": "Welcome_test::test_method_404" 
}{ 
    "event": "test", 
    "suite": "Welcome_test", 
    "test": "Welcome_test::test_method_404", 
    "status": "pass", 
    "time": 0.0022480487823486, 
    "trace": [], 
    "message": "", 
    "output": "" 
}.{ 
    "event": "testStart", 
    "suite": "Welcome_test", 
    "test": "Welcome_test::test_APPPATH" 
}{ 
    "event": "test", 
    "suite": "Welcome_test", 
    "test": "Welcome_test::test_APPPATH", 
    "status": "pass", 
    "time": 0.00034213066101074, 
    "trace": [], 
    "message": "", 
    "output": "" 
}. 

Time: 821 ms, Memory: 10.00Mb 

OK (3 tests, 3 assertions) 

が、誰も働かなかった。フォーマットの結果のみを示し、通常の形式で、私は私の結果を必要とする

PHPUnit 4.8.10 by Sebastian Bergmann and contributors. Starting test 'Welcome_test::test_index' . 

Starting test 'Welcome_test::test_method_404' . 

Starting test 'Welcome_test::test_APPPATH' . 

Time: 1.23 seconds, Memory: 13.25Mb OK (3 tests, 3 assertions) 

JSONで全体の実行プロセスを示しフォーマットは私のVisualPHPUnitを破るために作っています。 私phpunit.xmlは以下の通りです:

<phpunit bootstrap="./Bootstrap.php" backupGlobals="true" colors="true"> 
    <testsuites> 
     <testsuite name="CodeIgniter Application Test Suite"> 
      <directory suffix="test.php">./</directory> 
      <exclude>./_ci_phpunit_test/</exclude> 
     </testsuite> 
    </testsuites> 
    <filter> 
     <whitelist> 
      <directory suffix=".php">../controllers</directory> 
      <directory suffix=".php">../models</directory> 
      <directory suffix=".php">../views</directory> 
      <directory suffix=".php">../libraries</directory> 
      <directory suffix=".php">../helpers</directory> 
      <directory suffix=".php">../hooks</directory> 
     </whitelist> 
    </filter> 
    <logging> 
     <log type="coverage-html" target="build/coverage"/> 
     <log type="coverage-clover" target="build/logs/clover.xml"/> 
     <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/> 
    </logging> 
    <!-- This is required for VPU to work correctly --> 
    <listeners> 
     <listener class="PHPUnit_Util_Log_JSON"/> 
    </listeners> 
</phpunit> 

どれソリューション/提案?これはバグか設定上の問題ですか?

おかげで一般的に

+0

スイートを実行するために使用した設定とコマンドを共有できますか? –

+0

@MateuszSip設定の意味は?申し訳ありませんが、私はPHPUnitを初めて使用しています。 phpunit.xmlを意味する場合、私はちょうど質問に追加しました。私が使用しているコマンドは: php phpunit.phar 私もphp phpunit.pharを試しました - デバッグが動作しませんでした。私はしばらくここで立ち往生して以来、私は何か助けに感謝します。事前に感謝します – MrCujo

+1

'PHPUnit_Util_Log_JSON'のように見えます。私は 'VisualPHPUnit'リポジトリでそれについての言及を見ることができません。 –

答えて

0

PHPUnit_Util_Log_JSONリスナーはその責任がある:

<listeners> 
    <listener class="PHPUnit_Util_Log_JSON"/> 
</listeners> 

あなたはVisualPHPUnitに関するいくつかの助けを必要とする場合、私は試すことができますが、それはあなたの構成についてのいくつかの詳細を必要とする可能性があります。

これは本当に必要なツールですか、それとも素晴らしい機能ですか?

+0

まあ、それは素晴らしい追加だろう。私は上司にTDDを採用するように説得しているので、ブラウザを使って結果を調べるオプションを完璧にすることができます。設定に関するその他の詳細は何か必要ですか? – MrCujo

関連する問題