mirror of
https://codeberg.org/demostf/api.git
synced 2026-06-03 09:54:17 +02:00
add basic api tests
This commit is contained in:
parent
64b0aff075
commit
e00e6ece5f
30 changed files with 350 additions and 17 deletions
27
test/Data/DemoPlayerTest.php
Normal file
27
test/Data/DemoPlayerTest.php
Normal 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());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue