mirror of
				https://github.com/elyby/accounts.git
				synced 2025-05-31 14:11:46 +05:30 
			
		
		
		
	Добавлена логика HasJoined для сервера авторизации Minecraft
Исправлена ошибка в JoinForm Добавлено базовое API для общения с сервером системы скинов
This commit is contained in:
		@@ -0,0 +1,38 @@
 | 
			
		||||
<?php
 | 
			
		||||
namespace tests\codeception\api\functional\_steps;
 | 
			
		||||
 | 
			
		||||
use common\models\OauthScope as S;
 | 
			
		||||
use Faker\Provider\Uuid;
 | 
			
		||||
use tests\codeception\api\_pages\SessionServerRoute;
 | 
			
		||||
 | 
			
		||||
class SessionServerSteps extends \tests\codeception\api\FunctionalTester {
 | 
			
		||||
 | 
			
		||||
    public function amJoined($byLegacy = false) {
 | 
			
		||||
        $oauthSteps = new OauthSteps($this->scenario);
 | 
			
		||||
        $accessToken = $oauthSteps->getAccessToken([S::MINECRAFT_SERVER_SESSION]);
 | 
			
		||||
        $route = new SessionServerRoute($this);
 | 
			
		||||
        $serverId = Uuid::uuid();
 | 
			
		||||
        $username = 'Admin';
 | 
			
		||||
 | 
			
		||||
        if ($byLegacy) {
 | 
			
		||||
            $route->joinLegacy([
 | 
			
		||||
                'sessionId' => 'token:' . $accessToken . ':' . 'df936908-b2e1-544d-96f8-2977ec213022',
 | 
			
		||||
                'user' => $username,
 | 
			
		||||
                'serverId' => $serverId,
 | 
			
		||||
            ]);
 | 
			
		||||
 | 
			
		||||
            $this->canSeeResponseEquals('OK');
 | 
			
		||||
        } else {
 | 
			
		||||
            $route->join([
 | 
			
		||||
                'accessToken' => $accessToken,
 | 
			
		||||
                'selectedProfile' => 'df936908-b2e1-544d-96f8-2977ec213022',
 | 
			
		||||
                'serverId' => $serverId,
 | 
			
		||||
            ]);
 | 
			
		||||
 | 
			
		||||
            $this->canSeeResponseContainsJson(['id' => 'OK']);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return [$username, $serverId];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user