D
D
djpasica2013-11-25 00:06:07
PHP
djpasica, 2013-11-25 00:06:07

PHPUnit tests and executing shell commands in the background

I have a parser command:

wget -e robots=off -c -t0 --convert-links --strict-comments --span-hosts --no-check-certificate -p -E -q -nd -U 'Mozilla/5.0' --ignore-length --exclude-domains="tns-counter.ru" --reject='png,gif,bmp,jpeg,jpg,swf,svg,swg' --ignore-tags='iframe,frame' --keep-session-cookies  --referer "http://google.com/"   --header="Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3"  --header="Accept-Encoding: identity"  --header="UstPath()er-Agent: Mozilla/5.0"  -P '/home/www/grab/' 'http://google.com/' &

which, using wget, pulls the content, "&" at the end encodes the task into the background.
It works with the help of a function. shell_exec
Everything works fine, until I needed to write tests for it.
The test does not throw the task into the background, it waits until the parser gets everything and finishes its work, and only then continues its work
. What could be the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question