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

stricter cs

This commit is contained in:
Robin Appelman 2017-07-30 15:03:52 +02:00
commit d9a843ecd6
54 changed files with 346 additions and 168 deletions

View file

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace Demostf\API\Test\Demo;
@ -56,7 +58,7 @@ class DemoSaverTest extends TestCase {
3,
[
new ChatMessage('user1', 12, 'msg1'),
new ChatMessage('user2', 13, 'msg2')
new ChatMessage('user2', 13, 'msg2'),
],
[
new ParsedPlayer('user1', 1, '1234567', 'red', 'scout'),
@ -107,7 +109,7 @@ class DemoSaverTest extends TestCase {
$this->assertEquals([
new ChatMessage('user1', 12, 'msg1'),
new ChatMessage('user2', 13, 'msg2')
new ChatMessage('user2', 13, 'msg2'),
], $chatProvider->getChat($demoId));
}
}

View file

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace Demostf\API\Test\Demo;

View file

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace Demostf\API\Test\Demo;
@ -44,7 +46,7 @@ class HeaderParserTest extends TestCase {
*/
public function testNonDemoShort() {
$parser = new HeaderParser();
$parser->parseString("short");
$parser->parseString('short');
}
/**

View file

@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
namespace Demostf\API\Test\Demo;
@ -21,6 +23,7 @@ class ParserTest extends TestCase {
->method('parse')
->will($this->returnCallback(function ($path) {
$jsonPath = str_replace('.dem', '-raw.json', $path);
return json_decode(file_get_contents($jsonPath), true);
}));
}
@ -51,9 +54,9 @@ class ParserTest extends TestCase {
$expectedKills = $expectedRaw['kills'];
$this->assertCount(count($expectedKills), $result->getKills());
$this->assertEquals((int)$expectedKills[0]['killer'], $result->getKills()[0]->getAttackerDemoId());
$this->assertEquals((int)$expectedKills[0]['assister'], $result->getKills()[0]->getAssisterDemoId());
$this->assertEquals((int)$expectedKills[0]['victim'], $result->getKills()[0]->getVictimDemoId());
$this->assertEquals((int) $expectedKills[0]['killer'], $result->getKills()[0]->getAttackerDemoId());
$this->assertEquals((int) $expectedKills[0]['assister'], $result->getKills()[0]->getAssisterDemoId());
$this->assertEquals((int) $expectedKills[0]['victim'], $result->getKills()[0]->getVictimDemoId());
$this->assertEquals($expectedKills[0]['weapon'], $result->getKills()[0]->getWeapon());
}