mirror of
https://github.com/elyby/accounts.git
synced 2024-10-31 07:53:02 +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];
|
|
}
|
|
|
|
}
|