Last active
November 21, 2015 00:49
-
-
Save ValentinMerlet/7218e6d81baf5c8eb9e0 to your computer and use it in GitHub Desktop.
Behat : Fonction iRequest d'un fichier Context
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 | |
/** | |
* @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