You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Http client send method is called 2 times on a test
I would like to make different response objects for each of them
on one of them I would also like to have asserts
What do you get instead?
RN it is impossible to have different callbacks for consecutive calls
Provide console output if related. Use -vvv mode for more details.
Provide test source code if related
$oauth2Provider->setHttpClient($this->construct(Client::class, [], [
'send' => Expected::exactly(2,
function (RequestInterface$request) {
returnnewResponse(200, [
'content-type' => 'application/json'
], '{"access_token": "access", "expires_in": 3600, "refresh_token": "refresh"}');
},
function (RequestInterface$request) {
//assertions go herereturnnewResponse(200, [
], 'response body goes here');
}
]))
]));
Details
Codeception version:
PHP Version: 7.4.6
Operating System: Ubuntu
Installation type: Composer
List of installed packages (composer show)
Suite configuration:
# paste suite config here
Addittional info
RN I do this
$oauth2Provider->setHttpClient($this->construct(Client::class, [], [
'send' => Expected::exactly(2, Closure::fromCallable(newMultiCallable([
function (RequestInterface$request) {
returnnewResponse(200, [
'content-type' => 'application/json'
], '{"access_token": "access", "expires_in": 3600, "refresh_token": "refresh"}');
},
function (RequestInterface$request) {
//asserts go herereturnnewResponse(200, [
], 'response body goes here');
}
])))
]));
What are you trying to achieve?
Http client send method is called 2 times on a test
I would like to make different response objects for each of them
on one of them I would also like to have asserts
What do you get instead?
RN it is impossible to have different callbacks for consecutive calls
Details
composer show
)# paste suite config here
Addittional info
RN I do this
The text was updated successfully, but these errors were encountered: