Composerのautoload.phpをブートストラップファイルとして使用すると、PHPUnitCode_Coverageでエラーが発生します。独自のboostrap.phpファイルを作成し、各ファイルを個別に含めるだけで、すべてが正常に機能します。Composerのバグに遭遇したことがありますか、それともどこかでエラーが発生していますか?
//編集:すべての最新(最新)バージョンを使用しています:PHPUnit 3.7.12、Code_Coverage 1.2.7、Composer b51a4a7
Fatal error: Cannot redeclare class C3\CDN\EdgeCast in /Users/kperrine/Projects/edgecast-custom-reports/src/C3/CDN/EdgeCast.php on line 11
Call Stack:
0.0017 641760 1. {main}() /Applications/MAMP/bin/php/php5.3.14/bin/phpunit:0
0.2232 1111312 2. PHPUnit_TextUI_Command::main() /Applications/MAMP/bin/php/php5.3.14/bin/phpunit:46
0.2232 1112040 3. PHPUnit_TextUI_Command->run() /Applications/MAMP/bin/php/php5.3.14/lib/php/PHPUnit/TextUI/Command.php:129
0.3027 4636952 4. PHPUnit_TextUI_TestRunner->doRun() /Applications/MAMP/bin/php/php5.3.14/lib/php/PHPUnit/TextUI/Command.php:176
21.5764 6604032 5. PHP_CodeCoverage_Report_HTML->process() /Users/kperrine/Projects/edgecast-custom-reports/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php:384
21.5764 6604240 6. PHP_CodeCoverage->getReport() /Users/kperrine/Projects/edgecast-custom-reports/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML.php:120
21.5768 6663512 7. PHP_CodeCoverage_Report_Factory->create() /Users/kperrine/Projects/edgecast-custom-reports/vendor/phpunit/php-code-coverage/PHP/CodeCoverage.php:158
21.5769 6663512 8. PHP_CodeCoverage->getData() /Users/kperrine/Projects/edgecast-custom-reports/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/Factory.php:64
21.5769 6663512 9. PHP_CodeCoverage->addUncoveredFilesFromWhitelist() /Users/kperrine/Projects/edgecast-custom-reports/vendor/phpunit/php-code-coverage/PHP/CodeCoverage.php:190
21.5769 6664408 10. PHP_CodeCoverage->processUncoveredFileFromWhitelist() /Users/kperrine/Projects/edgecast-custom-reports/vendor/phpunit/php-code-coverage/PHP/CodeCoverage.php:535
21.5778 6757272 11. include_once('/Users/kperrine/Projects/edgecast-custom-reports/src/C3/CDN/EdgeCast.php') /Users/kperrine/Projects/edgecast-custom-reports/vendor/phpunit/php-code-coverage/PHP/CodeCoverage.php:558
私のphpunit.xmlは次のとおりです。
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
>
<testsuites>
<testsuite name="C3 EdgeCast Tests">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="log/report" charset="UTF-8"
highlight="false" lowUpperBound="35" highLowerBound="70"/>
</logging>
</phpunit>