phpunit の構成ファイルを作成する必要があります。その構成ファイル内で、特定のファイルまたはディレクトリをコード カバレッジから除外できます。
サンプル ファイルは次のようになります。
<phpunit stopOnFailure="false">
<testsuite name="Name">
</testsuite>
<filter>
<whitelist>
<directory suffix=".php">../php</directory>
<exclude>
<file>../php/somefile.php</file>
<directory suffix=".php">../php/pdf</directory>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="target-dir/coverage" charset="UTF-8" yui="true" highlight="true"/>
<log type="coverage-clover" target="target-dir/build/logs/clover.xml"/>
</logging>
</phpunit>
上記のファイルでは、ファイル ../php/somefile.php と拡張子.ディレクトリからのphp ../php/pdf
このファイルに phpunit.xml という名前を付け、テストを実行するディレクトリと同じディレクトリに配置します。phpunit を実行すると、conf が取得されます。
この特定のファイル名を使用できない場合は、コマンド ラインから名前を指定できます。
phpunit --configuration yourconf.xml
phpunit 構成ファイルの詳細については、http://phpunit.de/manual/3.7/en/appendixes.configuration.html を参照してください。