diff --git a/src/ApiContext.php b/src/ApiContext.php index ab6cfab..2ad0e6c 100644 --- a/src/ApiContext.php +++ b/src/ApiContext.php @@ -98,7 +98,7 @@ function ($item) { ), ]; - if (isset(self::$contexts['ETNA\FeatureContext\DoctrineContext'])) { + if (isset(self::$contexts['ETNA\FeatureContext\DoctrineContext']) && 'OPTIONS' !== $method) { self::$contexts['ETNA\FeatureContext\DoctrineContext']->checkMaxQueries($result); } @@ -159,6 +159,24 @@ public function jeDevraisAvoirUnResultatDApiEnJSON() $this->data = $json; } + /** + * @Given je sette le header :header_name à la valeur :header_value + */ + public function jeSetteLeHeaderAlAValeur($header_name, $header_value) + { + $this->request["headers"][$header_name] = $header_value; + } + + /** + * @Given je supprime le header :header_name + */ + public function jeSupprimeLeHeader() + { + if (isset($this->request["headers"][$header_name])) { + unset($this->request["headers"][$header_name]); + } + } + /** * @Given /^je devrais avoir un résultat d\'API en PDF$/ */