Skip to content

Instantly share code, notes, and snippets.

@alex-vlasov
Created July 9, 2014 09:11
Show Gist options
  • Save alex-vlasov/399e4d0987bc5b815d64 to your computer and use it in GitHub Desktop.
Save alex-vlasov/399e4d0987bc5b815d64 to your computer and use it in GitHub Desktop.
Add codeCoverageIgnore to all PHPUnit setup/teardown methods
find . -name '*.php' | xargs perl -0777 -i -pe 's#([;{}]\s*)([ \t]+(?:static )?(?:public|protected) (?:static )?function (?:setUp(?:BeforeClass)?|tearDown(?:AfterClass)?)\(\))#$1 /**\n * \@codeCoverageIgnore\n */\n $2#gis'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment