chore: sync
This commit is contained in:
@@ -58,7 +58,20 @@ final class AuthFlowTest extends TestCase
|
||||
], $cookie);
|
||||
$response3 = $app->handle($step3);
|
||||
self::assertSame(201, $response3->getStatusCode());
|
||||
$cookie = $this->extractCookie($response3, $cookie);
|
||||
$body3 = json_decode((string)$response3->getBody(), true);
|
||||
self::assertSame('pending', $body3['status']);
|
||||
|
||||
// confirm registration
|
||||
$pdo->exec("UPDATE users SET activation_token = 'confirm-token' WHERE username = 'neo'");
|
||||
$confirm = $this->jsonRequest($factory, 'POST', '/auth/register/confirm', [
|
||||
'token' => 'confirm-token',
|
||||
], $cookie);
|
||||
$confirmResponse = $app->handle($confirm);
|
||||
self::assertSame(200, $confirmResponse->getStatusCode());
|
||||
$confirmMeRequest = $factory->createServerRequest('POST', '/auth/register/confirm', ['token' => 'confirm-token']);
|
||||
$confirmMeRequest = $confirmMeRequest->withHeader('Cookie', $this->extractCookie($response3, $cookie));
|
||||
$confirmMeResponse = $app->handle($confirmMeRequest);
|
||||
self::assertSame(200, $confirmMeResponse->getStatusCode());
|
||||
|
||||
$meRequest = $factory->createServerRequest('GET', '/me');
|
||||
if ($cookie) {
|
||||
|
||||
Reference in New Issue
Block a user