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) {
|
||||
|
||||
@@ -19,7 +19,7 @@ final class TestAppFactory
|
||||
$container = Bootstrap::buildContainer([
|
||||
\PDO::class => $pdo,
|
||||
TimeProvider::class => $timeProvider,
|
||||
ConfigLoader::class => new ConfigLoader(new ConfigValidator(), $repoRoot . '/config'),
|
||||
ConfigLoader::class => ConfigLoader::fromDirectory(new ConfigValidator(), $repoRoot . '/config'),
|
||||
]);
|
||||
|
||||
return Bootstrap::createApp($container);
|
||||
|
||||
@@ -15,7 +15,7 @@ final class AutoCostCalculatorTest extends TestCase
|
||||
'capacity_add' => 3,
|
||||
],
|
||||
];
|
||||
$configLoader = new ConfigLoader($config);
|
||||
$configLoader = ConfigLoader::fromArray($config);
|
||||
$calculator = new AutoCostCalculator($configLoader);
|
||||
|
||||
$blueprint = [
|
||||
@@ -54,4 +54,4 @@ final class AutoCostCalculatorTest extends TestCase
|
||||
$this->assertEquals(100, $result['cost']);
|
||||
$this->assertEquals(60, $result['build_time']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user