mirror of
https://github.com/elyby/accounts.git
synced 2024-11-19 19:53:08 +05:30
25 lines
659 B
PHP
25 lines
659 B
PHP
<?php
|
|
namespace tests\codeception\api\functional\_steps;
|
|
|
|
use Ramsey\Uuid\Uuid;
|
|
use tests\codeception\api\_pages\AuthserverRoute;
|
|
use tests\codeception\api\FunctionalTester;
|
|
|
|
class AuthserverSteps extends FunctionalTester {
|
|
|
|
public function amAuthenticated() {
|
|
$route = new AuthserverRoute($this);
|
|
$clientToken = Uuid::uuid4()->toString();
|
|
$route->authenticate([
|
|
'username' => 'admin',
|
|
'password' => 'password_0',
|
|
'clientToken' => $clientToken,
|
|
]);
|
|
|
|
$accessToken = $this->grabDataFromResponseByJsonPath('$.accessToken')[0];
|
|
|
|
return [$accessToken, $clientToken];
|
|
}
|
|
|
|
}
|