mirror of
https://codeberg.org/demostf/api.git
synced 2026-06-03 18:04:08 +02:00
stricter cs
This commit is contained in:
parent
309ae17036
commit
d9a843ecd6
54 changed files with 346 additions and 168 deletions
|
|
@ -1,4 +1,6 @@
|
|||
<?php declare(strict_types = 1);
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Demostf\API\Test\Providers;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
<?php declare(strict_types=1);
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Demostf\API\Test\Providers;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
<?php declare(strict_types=1);
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Demostf\API\Test\Providers;
|
||||
|
||||
|
|
@ -149,11 +151,13 @@ class DemoProviderTest extends TestCase {
|
|||
|
||||
private function addPlayer(int $demoId, int $demoUserId, int $userId, string $team, string $class): int {
|
||||
$player = new Player(0, $demoId, $demoUserId, $userId, 'user_' . $userId, $team, $class);
|
||||
|
||||
return $this->playerProvider->store($player);
|
||||
}
|
||||
|
||||
private function addKill(int $demoId, int $attackerId, int $assisterId, int $victimId, string $weapon): int {
|
||||
$kill = new Kill(0, $demoId, $attackerId, $assisterId, $victimId, $weapon);
|
||||
|
||||
return $this->killProvider->store($kill);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
<?php declare(strict_types=1);
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Demostf\API\Test\Providers;
|
||||
|
||||
|
|
@ -25,7 +27,7 @@ class UploadProviderTest extends TestCase {
|
|||
private $headerParser;
|
||||
/** @var Parser */
|
||||
private $parser;
|
||||
/** @var DemoStore */
|
||||
/** @var DemoStore */
|
||||
private $demoStore;
|
||||
/** @var UserProvider */
|
||||
private $userProvider;
|
||||
|
|
@ -49,6 +51,7 @@ class UploadProviderTest extends TestCase {
|
|||
->method('parse')
|
||||
->will($this->returnCallback(function ($path) {
|
||||
$jsonPath = str_replace('.dem', '-raw.json', $path);
|
||||
|
||||
return json_decode(file_get_contents($jsonPath), true);
|
||||
}));
|
||||
|
||||
|
|
@ -290,11 +293,10 @@ class UploadProviderTest extends TestCase {
|
|||
$this->saveSteamId('[U:1:143626373]', 'Pendulum');
|
||||
$this->saveSteamId('[U:1:30220936]', 'Jedi');
|
||||
|
||||
|
||||
$result = $this->uploadProvider->upload($token, 'RED', 'BLU', 'foodemo', $this->tmpDir . '/foo.dem');
|
||||
$this->assertStringStartsWith('STV available at: http://example.com/', $result);
|
||||
|
||||
$demoId = (int)substr($result, strlen('STV available at: http://example.com/'));
|
||||
$demoId = (int) substr($result, strlen('STV available at: http://example.com/'));
|
||||
|
||||
$demo = $this->demoProvider->get($demoId, true);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
<?php declare(strict_types=1);
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Demostf\API\Test\Providers;
|
||||
|
||||
|
|
@ -72,7 +74,6 @@ class UserProviderTest extends TestCase {
|
|||
|
||||
$user = $this->provider->get($this->steamId->getSteamId64());
|
||||
|
||||
|
||||
$this->assertEquals($user->getId(), $id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue