loginAsAdmin($client); $client->request('POST', '/en/my-account/payment/'.TestReference::GROUP_OFFER_GROUP_1_1.'/prepare'); self::assertResponseIsUnprocessable(); } /** * Group offer ot found. */ public function testAcceptInvitationNotFoundException(): void { $client = self::createClient(); $this->loginAsUser11($client); $client->request('POST', '/en/my-account/payment/'.TestReference::UUID_404.'/prepare'); self::assertResponseStatusCodeSame(Response::HTTP_NOT_FOUND); } /** * Nominal case: click an offer to initialize the payment process. In the test * environment we use the "offline" gateway so the payment is always successful. */ public function testPrepareSuccess(): void { $client = self::createClient(); $this->loginAsAdmin($client); $crawler = $client->request('GET', self::ROUTE_SHOW_CHARGED); $form = $crawler->selectButton('templates.pages.group.show.payment_prepare.form.submit')->form(); $client->followRedirects(); $client->submit($form); self::assertResponseIsSuccessful(); self::assertRouteSame('app_group_show'); self::assertSelectorTextContains('body', 'flash.success'); } }