I am trying to use Behat to test BDD. When running the build on Jenkins, I would like Behat to open the PHP build on the web server and then close it after running the tests. How to do it?
Basically I need to run:
php -S localhost:8000
In my BDD tests, I tried:
public function iCallWithPostData($uri) { echo exec('php -S localhost:8000'); $client = new Guzzle\Service\Client(); $request = $client->post('http://localhost:8000' . $uri, array(), '{"email":"a","password":"a"}')->send(); $this->response = $request->getBody(true); }
But then when you start Behat, it gets stuck without any message.
source share