You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
1.8 KiB
72 lines
1.8 KiB
10 months ago
|
<?php
|
||
|
namespace App\Tests;
|
||
|
|
||
|
use App\Factory\CharacterFactory;
|
||
|
use App\Factory\DojoFactory;
|
||
|
use App\Factory\TournamentFactory;
|
||
|
use App\Factory\UserFactory;
|
||
|
|
||
|
class TournamentTest extends AbstractTest
|
||
|
{
|
||
|
|
||
|
// No need to create tournaments via API Endpoint ... will be done in cronjob
|
||
|
public function testRegisterCharacter(): void
|
||
|
{
|
||
|
$tournament = TournamentFactory::createOne();
|
||
|
|
||
|
$dojo = DojoFactory::createOne([
|
||
|
'owner' => UserFactory::createOne()
|
||
|
]);
|
||
|
|
||
|
$character = CharacterFactory::createOne([
|
||
|
'dojo' => $dojo
|
||
|
]);
|
||
|
|
||
|
$response = static::createClientWithToken($dojo->getOwner()->authName)->request('POST',
|
||
|
'/api/tournament_registrations',
|
||
|
[
|
||
|
'json' => [
|
||
|
'tournament' => $this->getIri($tournament),
|
||
|
'character' => $this->getIri($character)
|
||
|
]
|
||
|
]);
|
||
|
|
||
|
$this->assertResponseStatusCodeSame(201);
|
||
|
|
||
|
$this->assertArrayHasKey('id', $response->toArray());
|
||
|
}
|
||
|
|
||
|
public function testRegisterCharacterNotPossibleTwice(): void
|
||
|
{}
|
||
|
|
||
|
public function testRegisterCharacterOnPastTournament(): void
|
||
|
{}
|
||
|
|
||
|
public function testShowRegisteredCharacters(): void
|
||
|
{}
|
||
|
|
||
|
public function testListTournaments(): void
|
||
|
{}
|
||
|
|
||
|
/**
|
||
|
* Status is ...
|
||
|
* meta data like when it is starting, name, "location", Winner (nullable), etc.
|
||
|
*/
|
||
|
public function testTournamentStatus(): void
|
||
|
{}
|
||
|
|
||
|
// /api/tournament/{id}/fights
|
||
|
// readableLink: true -> participant ids and winner
|
||
|
public function testTournamentFights(): void
|
||
|
{}
|
||
|
|
||
|
// /api/tournament/{id}/character/{id}/fights
|
||
|
public function testTournamentFightsForCharacter(): void
|
||
|
{}
|
||
|
|
||
|
// /api/tournament/{id}/ranking
|
||
|
public function testTournamentRanking(): void
|
||
|
{}
|
||
|
}
|
||
|
|