Немного рефакторинга Join формы для учёта Legacy API

Добавлена поддержка чтения данных из POST запроса, если они переданы как RAW json
Исправлен StringHelper::isUuid()
This commit is contained in:
ErickSkrauch
2016-09-05 17:55:38 +03:00
parent 34d725abe2
commit e8b5e90a91
12 changed files with 338 additions and 49 deletions

View File

@@ -30,8 +30,19 @@ class JoinCest {
$this->expectSuccessResponse($I);
}
public function joinByModernOauth2Token(OauthSteps $I) {
$I->wantTo('join to server, using moder oAuth2 generated token');
public function joinByPassJsonInPost(AuthserverSteps $I) {
$I->wantTo('join to server, passing data in body as encoded json');
list($accessToken) = $I->amAuthenticated();
$this->route->join(json_encode([
'accessToken' => $accessToken,
'selectedProfile' => 'df936908-b2e1-544d-96f8-2977ec213022',
'serverId' => Uuid::uuid(),
]));
$this->expectSuccessResponse($I);
}
public function joinByOauth2Token(OauthSteps $I) {
$I->wantTo('join to server, using modern oAuth2 generated token');
$accessToken = $I->getAccessToken([S::MINECRAFT_SERVER_SESSION]);
$this->route->join([
'accessToken' => $accessToken,