Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
centreon
centreon-test-lib
Commits
94e2664f
Commit
94e2664f
authored
Nov 04, 2022
by
jeremyjaouen
Browse files
add method to authenticate
parent
b2319b65
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/behat/CentreonAPIContext.php
View file @
94e2664f
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment