mirror of
https://codeberg.org/demostf/api.git
synced 2026-06-03 09:54:17 +02:00
fmt, typings, typos
This commit is contained in:
parent
eb997b5ba2
commit
7de4c35ab4
34 changed files with 644 additions and 1048 deletions
|
|
@ -26,7 +26,7 @@ class DemoControllerTest extends ControllerTest {
|
|||
/** @var DemoListProvider|MockObject */
|
||||
private $demoListProvider;
|
||||
|
||||
public function setUp(): void {
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
|
||||
$this->demoStore = $this->createMock(DemoStore::class);
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class DemoSaverTest extends TestCase {
|
|||
$this->assertEquals('user2', $retrievedDemo->getUploaderUser()->getName());
|
||||
|
||||
$players = $retrievedDemo->getPlayers();
|
||||
usort($players, function(DemoPlayer $a, DemoPlayer $b) {
|
||||
usort($players, function (DemoPlayer $a, DemoPlayer $b) {
|
||||
return $a->getName() <=> $b->getName();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class HeaderParserTest extends TestCase {
|
|||
$this->assertEquals($expected->getMap(), $parsed->getMap());
|
||||
$this->assertEquals($expected->getNick(), $parsed->getNick());
|
||||
$this->assertEquals($expected->getProtocol(), $parsed->getProtocol());
|
||||
$this->assertEquals($expected->getSigon(), $parsed->getSigon());
|
||||
$this->assertEquals($expected->getSingOn(), $parsed->getSingOn());
|
||||
$this->assertEquals($expected->getType(), $parsed->getType());
|
||||
$this->assertEquals($expected->getVersion(), $parsed->getVersion());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class ParserTest extends TestCase {
|
|||
/** @var RawParser|MockObject */
|
||||
private $rawParser;
|
||||
|
||||
public function setUp(): void {
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
|
||||
$this->rawParser = $this->getMockBuilder(RawParser::class)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class ChatProviderTest extends TestCase {
|
|||
/** @var ChatProvider */
|
||||
private $provider;
|
||||
|
||||
public function setUp(): void {
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
|
||||
$this->provider = new ChatProvider($this->getDatabaseConnection());
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class DemoListProviderTest extends TestCase {
|
|||
/** @var UserProvider */
|
||||
private $userProvider;
|
||||
|
||||
public function setUp(): void {
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
|
||||
$this->demoListProvider = new DemoListProvider($this->getDatabaseConnection());
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class DemoProviderTest extends TestCase {
|
|||
/** @var PlayerProvider */
|
||||
private $playerProvider;
|
||||
|
||||
public function setUp(): void {
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
|
||||
$this->userProvider = new UserProvider($this->getDatabaseConnection(), $this->getRandomGenerator());
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class UploadProviderTest extends TestCase {
|
|||
/**
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public function setUp(): void {
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
|
||||
$this->rawParser = $this->getMockBuilder(RawParser::class)
|
||||
|
|
@ -111,7 +111,7 @@ class UploadProviderTest extends TestCase {
|
|||
rmdir($dir);
|
||||
}
|
||||
|
||||
public function tearDown(): void {
|
||||
protected function tearDown(): void {
|
||||
$this->rmdirr($this->tmpDir);
|
||||
|
||||
parent::tearDown();
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class UserProviderTest extends TestCase {
|
|||
/** @var SteamId */
|
||||
private $steamId;
|
||||
|
||||
public function setUp(): void {
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
|
||||
$this->steamId = $this->getSteamId('76561198024494988', 'Icewind');
|
||||
|
|
|
|||
|
|
@ -31,11 +31,11 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase {
|
|||
return $this->database;
|
||||
}
|
||||
|
||||
public function setUp(): void {
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
public function tearDown(): void {
|
||||
protected function tearDown(): void {
|
||||
$this->clearDatabase();
|
||||
parent::tearDown();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,14 +32,14 @@ if ('/upload' === $_SERVER['REQUEST_URI']) {
|
|||
require __DIR__ . '/../src/public/index.php';
|
||||
}
|
||||
|
||||
function clearDatabase(\Doctrine\DBAL\Connection $connection) {
|
||||
function clearDatabase(Doctrine\DBAL\Connection $connection) {
|
||||
$tables = $connection->getSchemaManager()->listTables();
|
||||
foreach ($tables as $table) {
|
||||
truncateTable($connection, $table->getName());
|
||||
}
|
||||
}
|
||||
|
||||
function truncateTable(\Doctrine\DBAL\Connection $connection, string $tableName) {
|
||||
function truncateTable(Doctrine\DBAL\Connection $connection, string $tableName) {
|
||||
$sql = sprintf('TRUNCATE TABLE %s;', $tableName);
|
||||
$connection->query($sql);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue