Skip to content

Instantly share code, notes, and snippets.

@Caffe1neAdd1ct
Created February 6, 2014 11:32
Show Gist options
  • Save Caffe1neAdd1ct/8842481 to your computer and use it in GitHub Desktop.
Save Caffe1neAdd1ct/8842481 to your computer and use it in GitHub Desktop.
Change sendmail path to a trapmail when running phpunit
#!/usr/bin/env php
<?php
/** Build arg string */
if(isset($argv)) {
/** Remove original phpunit script call argument */
unset($argv[0]);
/** Build arguments into a string */
$argString = null;
foreach( $argv as $arg ) {
$argString .= '"' . $arg . '" ';
}
/** Run new test command */
echo shell_exec('/usr/bin/php -d sendmail_path=/usr/local/bin/trapmail /usr/bin/phpunit ' . $argString);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment