1
0
Fork 0
mirror of https://codeberg.org/demostf/api.git synced 2026-06-03 18:04:08 +02:00

cleanup and tests

This commit is contained in:
Robin Appelman 2017-04-09 17:24:15 +02:00
commit 05f48fd0a0
7 changed files with 110 additions and 25 deletions

View file

@ -0,0 +1,27 @@
<?php declare(strict_types=1);
namespace Demostf\API\Test\Data;
use Demostf\API\Data\DemoPlayer;
use Demostf\API\Test\TestCase;
class DemoPlayerTest extends TestCase {
public function testParseSerialize() {
$data = [
'id' => 1,
'user_id' => 2,
'name' => 'foo',
'team' => 'red',
'class' => 'sniper',
'steamid' => 'asd',
'avatar' => 'asd.png',
'kills' => 5,
'assists' => 3,
'deaths' => 7
];
$demoPlayer = DemoPlayer::fromRow($data);
$this->assertEquals($data, $demoPlayer->jsonSerialize());
}
}