When using phpunit.xml, you can configure filters to exclude files with specific names, in particular folders or with a specific extension.
.
:
<testsuite name="Application Test Suite">
<directory>./application/</directory>
</testsuite>
<filter>
<blacklist>
HERE
</blacklist>
or alternatively
<whitelist>
<directory suffix=".php">../library/</directory>
<directory suffix=".php">../application/</directory>
<exclude>
AND HERE
<directory suffix=".phtml">../application/</directory>
</exclude>
</whitelist>
</filter>