Skip to content

Instantly share code, notes, and snippets.

@DavertMik
Created December 16, 2012 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavertMik/4309132 to your computer and use it in GitHub Desktop.
Save DavertMik/4309132 to your computer and use it in GitHub Desktop.
PHPUnit was written by robots. Really
<?php
$codeCoverage->setProcessUncoveredFilesFromWhitelist(
$arguments['processUncoveredFilesFromWhitelist']
);
if (isset($arguments['forceCoversAnnotation'])) {
$codeCoverage->setForceCoversAnnotation(
$arguments['forceCoversAnnotation']
);
}
if (isset($arguments['mapTestClassNameToCoveredClassName'])) {
$codeCoverage->setMapTestClassNameToCoveredClassName(
$arguments['mapTestClassNameToCoveredClassName']
);
}
@DavertMik
Copy link
Author

<?php

$expectedArguments = array('processUncoveredFilesFromWhitelist', 'forceCoversAnnotation', 'mapTestClassNameToCoveredClassName');

foreach ($arguments as $argName => $argValue) {
   if (in_array($argName, $expectedArguments) {
       $setter = 'set'. ucfirst($arg);
       $codeCoverage->$setter($argValue);
   }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment