assertInstanceOf(KernelInterface::class, self::$kernel); $this->seasonRepository = $container->get(SeasonRepository::class); $application = new Application(self::$kernel); $command = $application->find('tvdt:claim-season'); $this->commandTester = new CommandTester($command); } public function testSeasonClaim(): void { $this->commandTester->execute([ 'season-code' => 'krtek', 'email' => 'test@example.org', ]); $season = $this->seasonRepository->findOneBySeasonCode('krtek'); $this->assertInstanceOf(Season::class, $season); $this->assertSame(Command::SUCCESS, $this->commandTester->getStatusCode()); $this->assertCount(3, $season->owners); } public function testInvalidEmailFails(): void { $this->commandTester->execute([ 'season-code' => 'krtek', 'email' => 'nonexisting@example.org', ]); $this->assertSame(Command::FAILURE, $this->commandTester->getStatusCode()); } public function testInvalidSeasonCodeFails(): void { $this->commandTester->execute([ 'season-code' => 'dhadk', 'email' => 'test@example.org', ]); $this->assertSame(Command::FAILURE, $this->commandTester->getStatusCode()); } }