mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-21 06:19:38 +08:00
39 lines
956 B
PHP
39 lines
956 B
PHP
<?php
|
|
|
|
namespace Tests;
|
|
|
|
use App\Models\Player;
|
|
use App\Models\Texture;
|
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
|
|
class PlayerTest extends TestCase
|
|
{
|
|
use DatabaseTransactions;
|
|
|
|
public function testGetTexture()
|
|
{
|
|
$skin = factory(Texture::class)->create();
|
|
$player = factory(Player::class)->create(['tid_skin' => $skin->tid]);
|
|
|
|
$player = Player::find($player->pid);
|
|
$this->assertEquals($skin->hash, $player->getTexture('skin'));
|
|
|
|
$this->assertFalse($player->getTexture('invalid_type'));
|
|
}
|
|
|
|
/**
|
|
* @expectedException InvalidArgumentException
|
|
*/
|
|
public function testGetJsonProfile()
|
|
{
|
|
$player = factory(Player::class)->make();
|
|
$this->assertNull($player->getJsonProfile(-1));
|
|
}
|
|
|
|
public function testGetPlayerName()
|
|
{
|
|
$player = factory(Player::class)->make();
|
|
$this->assertEquals($player->name, $player->player_name);
|
|
}
|
|
}
|