mirror of
https://github.com/elyby/accounts.git
synced 2024-12-04 20:49:48 +05:30
27 lines
718 B
PHP
27 lines
718 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace api\tests\functional\_steps;
|
|
|
|
use api\tests\_pages\AuthserverRoute;
|
|
use api\tests\FunctionalTester;
|
|
use Ramsey\Uuid\Uuid;
|
|
|
|
class AuthserverSteps extends FunctionalTester {
|
|
|
|
public function amAuthenticated(string $asUsername = 'admin', string $password = 'password_0'): array {
|
|
$route = new AuthserverRoute($this);
|
|
$clientToken = Uuid::uuid4()->toString();
|
|
$route->authenticate([
|
|
'username' => $asUsername,
|
|
'password' => $password,
|
|
'clientToken' => $clientToken,
|
|
]);
|
|
|
|
$accessToken = $this->grabDataFromResponseByJsonPath('$.accessToken')[0];
|
|
|
|
return [$accessToken, $clientToken];
|
|
}
|
|
|
|
}
|