Created
February 6, 2014 11:32
-
-
Save Caffe1neAdd1ct/8842481 to your computer and use it in GitHub Desktop.
Change sendmail path to a trapmail when running phpunit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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