Skip to content

Commit

Permalink
Ajout de steps pour parametrer les headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume DUBOST committed Apr 19, 2019
1 parent 4cc194a commit 6f825de
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/ApiContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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$/
*/
Expand Down

0 comments on commit 6f825de

Please sign in to comment.