Реализован функционал Mojang API

Исправлена ошибка доступа к authserver из-за перехода на использование хостов, а не доменов
This commit is contained in:
ErickSkrauch
2016-09-21 11:13:43 +03:00
parent 78e5d3e103
commit df1859f0c1
17 changed files with 576 additions and 10 deletions

View File

@@ -0,0 +1,27 @@
<?php
namespace tests\codeception\api\_pages;
use yii\codeception\BasePage;
/**
* @property \tests\codeception\api\FunctionalTester $actor
*/
class MojangApiRoute extends BasePage {
public function usernameToUuid($username, $at = null) {
$this->route = '/mojang/profiles/' . $username;
$params = $at === null ? [] : ['at' => $at];
$this->actor->sendGET($this->getUrl(), $params);
}
public function usernamesByUuid($uuid) {
$this->route = "/mojang/profiles/{$uuid}/names";
$this->actor->sendGET($this->getUrl());
}
public function uuidsByUsernames($uuids) {
$this->route = '/mojang/profiles';
$this->actor->sendPOST($this->getUrl(), $uuids);
}
}