Last active
August 29, 2015 14:07
-
-
Save wizardishungry/a3ebb838aa3dbfe44e2d to your computer and use it in GitHub Desktop.
testcase for phpunit process isolation bug
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
I ran into a problem where php was invoking the wrong command-line for process isolation. This occurs when the script calling php is a #!/usr/bin/php called via direct execution | |
php ../publications/util_scripts/CommitTest.php -c | |
└─sh -c phpunit /opt/git/ReleaseApp/vendor/mm/publications/util_scripts/../library/Mmf/Test/Suite/Integration/CodeLibrary.php | |
└─phpunit /usr/bin/phpunit /opt/git/ReleaseApp/vendor/mm/publications/util_scripts/../library/Mmf/Test/Suite/Integration/CodeLibrary.php | |
└─sh -c '../publications/util_scripts/CommitTest.php' | |
└─php ../publications/util_scripts/CommitTest.php | |
└─sh -c phpunit /opt/git/ReleaseApp/vendor/mm/publications/util_scripts/../library/Mmf/Test/Suite/Integration/Frontend.php | |
└─phpunit /usr/bin/phpunit /opt/git/ReleaseApp/vendor/mm/publications/util_scripts/../library/Mmf/Test/Suite/Integration/Frontend.php | |
TEST: | |
./harnass.php go | |
BREAKS | |
php ./harnass.php go | |
WORKS |
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
<?php | |
/** | |
* @runTestsInSeparateProcesses | |
*/ | |
class MyCase extends PHPUnit_Framework_TestCase | |
{ | |
public function testWhatHappensNext() | |
{ | |
//sleep(10); | |
$this->assertFalse(false); | |
} | |
} |
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 | |
if(@$argv[1] != "go") { | |
echo "Run this testcase by `./harnass.php go`\n"; | |
exit; | |
} | |
echo "in test harnass, going to run phpunit"; | |
passthru("phpunit -v -v --debug Case.php"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment