Skip to content

Instantly share code, notes, and snippets.

@ValentinMerlet
Last active November 21, 2015 00:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ValentinMerlet/7218e6d81baf5c8eb9e0 to your computer and use it in GitHub Desktop.
Save ValentinMerlet/7218e6d81baf5c8eb9e0 to your computer and use it in GitHub Desktop.
Behat : Fonction iRequest d'un fichier Context
<?php
/**
* @When /^I request "(GET|POST) ([^"]*)"$/
*/
public function iRequest($httpMethod, $resource)
{
$this->resource = $resource;
$method = strtolower($httpMethod);
$this->request = $this->client->$method($resource);
foreach ($this->headers as $key => $val) {
$this->request->setHeader($key, $val);
}
$this->response = $this->request->send();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment