loginAsUser11($client); $client->request('POST', '/en/my-account/groups/'.TestReference::GROUP_PRIVATE.'/acceptInvitation'); self::assertResponseIsUnprocessable(); } /** * Group not found. */ public function testAcceptInvitationNotFoundException(): void { $client = self::createClient(); $this->loginAsUser11($client); $client->request('POST', '/en/my-account/groups/'.TestReference::UUID_404.'/acceptInvitation'); self::assertResponseStatusCodeSame(Response::HTTP_NOT_FOUND); } /** * Nominal case: accept the invitation by clicking on the link. */ public function testAcceptInvitationSuccess(): void { $client = self::createClient(); $this->loginAsUser11($client); $crawler = $client->request('GET', self::ROUTE_SHOW); self::assertResponseIsSuccessful(); $form = $crawler->selectButton('templates.pages.group.show.form.accept_invitation.submit')->form(); $client->submit($form); self::assertResponseRedirects(); $client->followRedirect(); self::assertResponseIsSuccessful(); self::assertRouteSame('app_group_show'); } }