Переписаны тесты для AccountQueueController, чтобы они не делали запросов в сеть

Забыл комитнуть изменения для консольных тестов
This commit is contained in:
ErickSkrauch
2016-10-31 02:47:18 +03:00
parent 6af7b4325c
commit 7ec87e0602
6 changed files with 160 additions and 95 deletions

View File

@@ -37,7 +37,7 @@ class AccountQueueController extends AmqpController {
}
public function routeUsernameChanged(UsernameChanged $body) {
$mojangApi = new MojangApi();
$mojangApi = $this->createMojangApi();
try {
$response = $mojangApi->usernameToUUID($body->newUsername);
} catch (NoContentException $e) {
@@ -68,4 +68,11 @@ class AccountQueueController extends AmqpController {
return true;
}
/**
* @return MojangApi
*/
protected function createMojangApi() : MojangApi {
return new MojangApi();
}
}