From 99623cbe9a51f3ca6951200dbab190ca80fc6ddc Mon Sep 17 00:00:00 2001 From: Albin Date: Wed, 15 Nov 2023 21:43:19 +0100 Subject: [PATCH] =?UTF-8?q?feat=20(afup#1110):=20functional=20test=20Site?= =?UTF-8?q?=20public=20:=20-=20Adh=C3=A9sion=20personne=20morale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/config/config_test.yml | 3 +++ .../Controller/MemberShipController.php | 7 ++++++- .../features/PublicSite/Register.feature | 21 ++++++++++++++++--- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/app/config/config_test.yml b/app/config/config_test.yml index 4f7d822f8..b1893c857 100644 --- a/app/config/config_test.yml +++ b/app/config/config_test.yml @@ -25,3 +25,6 @@ services: AppBundle\Offices\OfficeFinder: class: AppBundle\Offices\NullOfficeFinder arguments: [ '@Geocoder\Provider\GoogleMaps' ] + +ewz_recaptcha: + enabled: false diff --git a/sources/AppBundle/Controller/MemberShipController.php b/sources/AppBundle/Controller/MemberShipController.php index d72865fc1..2d93a702d 100644 --- a/sources/AppBundle/Controller/MemberShipController.php +++ b/sources/AppBundle/Controller/MemberShipController.php @@ -54,7 +54,12 @@ public function becomeMemberAction() public function companyAction(Request $request) { - $subscribeForm = $this->createForm(CompanyMemberType::class); + $data = new CompanyMember(); + $data->setInvitations([ + (new CompanyMemberInvitation())->setManager(true) + ]); + + $subscribeForm = $this->createForm(CompanyMemberType::class, $data); $subscribeForm->handleRequest($request); if ($subscribeForm->isSubmitted() && $subscribeForm->isValid()) { diff --git a/tests/behat/features/PublicSite/Register.feature b/tests/behat/features/PublicSite/Register.feature index 5cc5d40c1..6dd90d2c9 100644 --- a/tests/behat/features/PublicSite/Register.feature +++ b/tests/behat/features/PublicSite/Register.feature @@ -52,12 +52,27 @@ Feature: Site Public - Register And I fill in "company_member_address" with "45 rue des Roses" And I fill in "company_member_zipcode" with "69003" And I fill in "company_member_city" with "LYON" - And I fill in "company_member_firstName" with "Mon prénom" - And I fill in "company_member_lastName" with "Mon nom" + And I fill in "company_member_firstName" with "Mon prénom de dirigeant" + And I fill in "company_member_lastName" with "Mon nom de dirigeant" And I fill in "company_member_email" with "registeredCompany@gmail.com" And I fill in "company_member_phone" with "0123456" - And print last response And I fill in "company_member[invitations][0][email]" with "registeredUser@gmail.com" And I press "Enregistrer mon adhésion" And I should see "Adhésion enregistrée !" And I should see "Montant de la cotisation: 150.00 Euros" + When I press "Régler par carte" + # Pour suivre la redirection POST de Paybox + And I submit the form with name "PAYBOX" + When I fill in "NUMERO_CARTE" with "1111222233334444" + And I select "12" from "MOIS_VALIDITE" + And I select "25" from "AN_VALIDITE" + And I fill in "CVVX" with "123" + And I press "Valider" + Then I should see "PAIEMENT ACCEPTÉ" + When I follow "Retour" + Then I should see "Le paiement de votre cotisation s'est bien passé, merci." + # Simuler l'appel de callback Paybox + And simulate the Paybox callback + And I should only receive the following emails: + | to | subject | + | | Une société vous invite à profiter de son compte "Membre AFUP" |