mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2025-01-18 13:54:01 +08:00
Add getter for compat
This commit is contained in:
parent
6d5ab8ed2e
commit
b8b8a8493c
@ -94,4 +94,15 @@ class Player extends Model
|
|||||||
|
|
||||||
return json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
|
return json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO: This is only for compatibility of 3rd plugins.
|
||||||
|
* Remove this in next major version.
|
||||||
|
*
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
public function getPlayerNameAttribute()
|
||||||
|
{
|
||||||
|
return $this->name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,4 +29,10 @@ class PlayerTest extends TestCase
|
|||||||
$player = factory(Player::class)->make();
|
$player = factory(Player::class)->make();
|
||||||
$this->assertNull($player->getJsonProfile(-1));
|
$this->assertNull($player->getJsonProfile(-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testGetPlayerName()
|
||||||
|
{
|
||||||
|
$player = factory(Player::class)->make();
|
||||||
|
$this->assertEquals($player->name, $player->player_name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user