mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Перенесены тесты со старого authserver, исправлены ошибки в коде
This commit is contained in:
24
tests/codeception/api/functional/_steps/AuthserverSteps.php
Normal file
24
tests/codeception/api/functional/_steps/AuthserverSteps.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?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];
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user