Commit 94e2664f authored by jeremyjaouen's avatar jeremyjaouen
Browse files

add method to authenticate

parent b2319b65
......@@ -336,6 +336,21 @@ class CentreonAPIContext extends CentreonContext
$this->setResponse($response);
}
/**
* @When I make an authentication request with credentials ":alias" / ":password"
*/
public function makeAnAuthenticationRequest($alias, $password)
{
$client = $this->getClient();
$response = $client->post($this->getMinkParameter('api_base') . '/api/index.php?action=authenticate', [
'form_params' => [
'username' => $alias,
'password' => $password
]
]);
$this->setResponse($response);
}
/**
* @When /^I make a MULTIPART request to "([^"]*)"$/
* @throws \Exception
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment