Skip to content

Instantly share code, notes, and snippets.

@alex-vlasov
Created July 9, 2014 08:42
Show Gist options
  • Save alex-vlasov/434ddc41847450f01406 to your computer and use it in GitHub Desktop.
Save alex-vlasov/434ddc41847450f01406 to your computer and use it in GitHub Desktop.
Add codeCoverageIgnore to all PHPUnit tests (existing comments)
find . -name '*.php' | xargs perl -0777 -i -pe 's#([ \t]+\/\*\*\s*?\n)(([ \t]+\*[ \t]+(?!@codeCoverageIgnore)[^\n]*?\n)*)\s+\*\/\s*([ \t]+(?:public|protected) function (?:setUp(?:BeforeClass)?|tearDown(?:AfterClass)?)\(\))# /**\n * \@codeCoverageIgnore\n$2 */\n $4#gis'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment