php - making a PHPUnit assertion only after a system process has finished running -


I am trying to test the outcome of a background shell process (running with exec ()). For this, I need to claim PHPUnit until the process is over.

I was wondering what is the best way to do this? Should I check the process of running in the loop, and use sleep () with very few parameters to wait until it ends?

Since no one responds to a day, I'm going to take a shot:

The first impulsive answer would be: "You should not do this". It does not really match (such that it is not really fast to run that test).

If you are writing a test for a class, then the call that the script does not really test you one thing, but two The class that calls the command line script and the script itself is itself and you can intercept the shell.

If you are trying to make sure that exec my first idea works then your test is such a way that the shell process is not in the form of background work but as a foreground task And the "wait" solution does not arise as the need to eliminate.

Hope that helped one litem


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -