Fixes ACCOUNTS-5GP. Use container rather then components map to obtain Mojang's API

This commit is contained in:
ErickSkrauch 2019-05-13 20:50:15 +03:00
parent 194a7acd2a
commit a9453aae67
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ class PullMojangUsername implements JobInterface {
public function execute($queue) {
Yii::$app->statsd->inc('queue.pullMojangUsername.attempt');
/** @var MojangApi $mojangApi */
$mojangApi = Yii::$app->get(MojangApi::class);
$mojangApi = Yii::$container->get(MojangApi::class);
try {
$response = $mojangApi->usernameToUUID($this->username);
Yii::$app->statsd->inc('queue.pullMojangUsername.found');

View File

@ -37,7 +37,7 @@ class PullMojangUsernameTest extends TestCase {
$mockApi = $this->createMock(MojangApi::class);
$this->mockedMethod = $mockApi->method('usernameToUUID');
Yii::$app->set(MojangApi::class, $mockApi);
Yii::$container->set(MojangApi::class, $mockApi);
}
public function testCreateFromAccount() {