mirror of
https://github.com/elyby/accounts.git
synced 2024-12-27 23:50:19 +05:30
Fixes ACCOUNTS-5GP. Use container rather then components map to obtain Mojang's API
This commit is contained in:
parent
194a7acd2a
commit
a9453aae67
@ -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');
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user