diff options
Diffstat (limited to 'build/integration/features/bootstrap/Auth.php')
-rw-r--r-- | build/integration/features/bootstrap/Auth.php | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/build/integration/features/bootstrap/Auth.php b/build/integration/features/bootstrap/Auth.php index e0eb5393bb8..f4b1a3e5b47 100644 --- a/build/integration/features/bootstrap/Auth.php +++ b/build/integration/features/bootstrap/Auth.php @@ -67,13 +67,21 @@ trait Auth { * @Given a new client token is used */ public function aNewClientTokenIsUsed() { + $this->loggingInUsingWebAs('user0'); + + $fullUrl = substr($this->baseUrl, 0, -5) . '/index.php/settings/personal/authtokens'; $client = new Client(); - $resp = $client->post(substr($this->baseUrl, 0, -5) . '/token/generate', [ - 'json' => [ - 'user' => 'user0', - 'password' => '123456', - ] - ]); + $options = [ + 'auth' => ['user0', '123456'], + 'body' => [ + 'requesttoken' => $this->requestToken, + 'name' => md5(microtime()), + ], + 'cookies' => $this->cookieJar, + ]; + + $resp = $client->send($client->createRequest('POST', $fullUrl, $options)); + $this->clientToken = json_decode($resp->getBody()->getContents())->token; } |