From 0c1153be17391dd5b77e501191227fddc1671c40 Mon Sep 17 00:00:00 2001 From: Adrien Gallou Date: Thu, 1 Jan 2026 15:29:41 +0100 Subject: [PATCH] =?UTF-8?q?adaptation=20des=20tests=20=C3=A0=202026?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avec le changement d'année les tests ne passent plus. On adapte les tests pour qu'ils passent sur cette nouvelle année --- db/seeds/ComptaPeriode.php | 6 ++++ db/seeds/Facture.php | 33 +++++++++++++++++++ .../Admin/Tresorerie/DevisFactures.feature | 32 +++++++++--------- .../features/EventPages/Ticketing.feature | 2 +- .../behat/features/MembersArea/Index.feature | 2 +- .../features/PublicSite/Register.feature | 4 +-- 6 files changed, 59 insertions(+), 20 deletions(-) diff --git a/db/seeds/ComptaPeriode.php b/db/seeds/ComptaPeriode.php index 23d177576..037efa692 100644 --- a/db/seeds/ComptaPeriode.php +++ b/db/seeds/ComptaPeriode.php @@ -99,6 +99,12 @@ public function run(): void 'date_fin' => '2024-12-31', 'verouiller' => 0, ], + [ + 'id' => 16, + 'date_debut' => '2025-01-01', + 'date_fin' => '2025-12-31', + 'verouiller' => 0, + ], ]; $table = $this->table('compta_periode'); diff --git a/db/seeds/Facture.php b/db/seeds/Facture.php index 821e112de..dc0d10b36 100644 --- a/db/seeds/Facture.php +++ b/db/seeds/Facture.php @@ -109,6 +109,31 @@ public function run(): void 'ref_clt3' => '', 'tel' => '', ], + // on a besoin d'une facture avant 2024 pour tester les exports sans TVA + [ + 'id' => '5', + 'date_devis' => "2023-06-10", + 'numero_devis' => "2023-01", + 'date_facture' => "2023-06-11", + 'numero_facture' => "2023-01", + 'societe' => 'Krampouz', + 'adresse' => '3, rue du port', + 'code_postal' => '29000', + 'ville' => 'Quimper', + 'id_pays' => 'FR', + 'email' => 'mail@testmail.fr', + 'tva_intra' => null, + 'nom' => 'Le kellen', + 'prenom' => 'Yan', + 'etat_paiement' => 1, + 'devise_facture' => 'EUR', + 'ref_clt1' => "Forum PHP 2023", + 'service' => '', + 'observation' => '', + 'ref_clt2' => '', + 'ref_clt3' => '', + 'tel' => '', + ], ]; $table = $this->table('afup_compta_facture'); @@ -145,6 +170,14 @@ public function run(): void 'pu' => '1000', 'tva' => '20', ], + [ + 'idafup_compta_facture' => '5', + 'ref' => "forum_php_2023", + 'designation' => "Forum PHP 2023 - Sponsoring Bronze", + 'quantite' => '1', + 'pu' => '1000', + 'tva' => '20', + ], ]; $table = $this->table('afup_compta_facture_details'); diff --git a/tests/behat/features/Admin/Tresorerie/DevisFactures.feature b/tests/behat/features/Admin/Tresorerie/DevisFactures.feature index 92528720b..e93cf8e79 100644 --- a/tests/behat/features/Admin/Tresorerie/DevisFactures.feature +++ b/tests/behat/features/Admin/Tresorerie/DevisFactures.feature @@ -88,7 +88,7 @@ Feature: Administration - Trésorerie - Devis/Facture And I should see "Paris Cedex 7" And I should see "Payé" # Envoi de la facture par email - Then I follow the button of tooltip "Envoyer la facture 2025-3 par mail" + Then I follow the button of tooltip "Envoyer la facture 2026-3 par mail" And I should only receive the following emails: | from | to | subject | | | | Facture AFUP | @@ -100,7 +100,7 @@ Feature: Administration - Trésorerie - Devis/Facture # Téléchargement de la facture When I go to "/admin/" And I follow "Factures" - And I follow the button of tooltip "Télécharger la facture 2025-3" + And I follow the button of tooltip "Télécharger la facture 2026-3" Then the response header "Content-disposition" should match '#attachment; filename="Facture - ESN dev en folie - (.*).pdf"#' When I parse the pdf downloaded content Then The page "1" of the PDF should contain "N° TVA Intracommunautaire : FR7612345" @@ -110,7 +110,7 @@ Feature: Administration - Trésorerie - Devis/Facture Scenario: Vérification de la devise par défaut (Euro) # Téléchargement du devis Given I am logged in as admin and on the Administration - When I go to "/admin/accounting/quotations/list?periodId=15" + When I go to "/admin/accounting/quotations/list?periodId=16" Then the ".content h2" element should contain "Liste des devis" And I should see "My company Ltd" And I follow the button of tooltip "Télécharger le devis My company Ltd" @@ -145,20 +145,20 @@ Feature: Administration - Trésorerie - Devis/Facture @vat Scenario: Test du PDF de facture après 2024 Given I am logged in as admin and on the Administration - When I go to "/admin/accounting/invoices/list?periodId=15" + When I go to "/admin/accounting/invoices/list?periodId=16" Then the ".content h2" element should contain "Factures" And I should see "Il n'est pas possible de créer directement une facture" - When I follow the button of tooltip "Télécharger la facture 2024-02" - Then the response header "Content-disposition" should equal 'attachment; filename="Facture - Krampouz - 2024-01-04.pdf"' + When I follow the button of tooltip "Télécharger la facture 2025-02" + Then the response header "Content-disposition" should equal 'attachment; filename="Facture - Krampouz - 2025-01-04.pdf"' Given I parse the pdf downloaded content - Then The page "1" of the PDF should contain "Le 04/01/2024" + Then The page "1" of the PDF should contain "Le 04/01/2025" Then The page "1" of the PDF should contain "Krampouz" Then The page "1" of the PDF should contain "3, rue du port" - Then The page "1" of the PDF should contain "Facture n° 2024-02" - Then The page "1" of the PDF should contain "Repère(s) : Forum PHP 2024" + Then The page "1" of the PDF should contain "Facture n° 2025-02" + Then The page "1" of the PDF should contain "Repère(s) : Forum PHP 2025" Then The page "1" of the PDF should contain "Comme convenu, nous vous prions de trouver votre facture" Then The page "1" of the PDF should contain "Type Description Quantite TVA Prix HT Total TTC" - Then The page "1" of the PDF should contain "forum_php_2024 Forum PHP 2024 - Sponsoring" + Then The page "1" of the PDF should contain "forum_php_2025 Forum PHP 2025 - Sponsoring" Then The page "1" of the PDF should contain "Bronze 1.00 20.00% 1 000,00 € 1 200,00 €" Then The page "1" of the PDF should contain "TOTAL HT 1 000,00 €" Then The page "1" of the PDF should contain "Total TVA 20.00% 200,00 €" @@ -191,19 +191,19 @@ Feature: Administration - Trésorerie - Devis/Facture @vat Scenario: Test du PDF de devis après 2024 Given I am logged in as admin and on the Administration - When I go to "/admin/accounting/quotations/list?periodId=15" + When I go to "/admin/accounting/quotations/list?periodId=16" Then the ".content h2" element should contain "Liste des devis" When I follow the button of tooltip "Télécharger le devis Krampouz" - Then the response header "Content-disposition" should equal 'attachment; filename="Devis - Krampouz - 2024-01-03.pdf"' + Then the response header "Content-disposition" should equal 'attachment; filename="Devis - Krampouz - 2025-01-03.pdf"' Given I parse the pdf downloaded content - Then The page "1" of the PDF should contain "Le 03/01/2024" + Then The page "1" of the PDF should contain "Le 03/01/2025" Then The page "1" of the PDF should contain "Krampouz" Then The page "1" of the PDF should contain "3, rue du port" - Then The page "1" of the PDF should contain "Devis n° 2024-02" - Then The page "1" of the PDF should contain "Repère(s) : Forum PHP 2024" + Then The page "1" of the PDF should contain "Devis n° 2025-02" + Then The page "1" of the PDF should contain "Repère(s) : Forum PHP 2025" Then The page "1" of the PDF should contain "Comme convenu, nous vous prions de trouver votre devis" Then The page "1" of the PDF should contain "Type Description Quantite TVA Prix HT Total TTC" - Then The page "1" of the PDF should contain "forum_php_2024 Forum PHP 2024 - Sponsoring" + Then The page "1" of the PDF should contain "forum_php_2025 Forum PHP 2025 - Sponsoring" Then The page "1" of the PDF should contain "Bronze 1.00 20.00% 1 000,00 € 1 200,00 €" Then The page "1" of the PDF should contain "TOTAL HT 1 000,00 €" Then The page "1" of the PDF should contain "Total TVA 20.00% 200,00 €" diff --git a/tests/behat/features/EventPages/Ticketing.feature b/tests/behat/features/EventPages/Ticketing.feature index dc0feb51b..46d7d6268 100644 --- a/tests/behat/features/EventPages/Ticketing.feature +++ b/tests/behat/features/EventPages/Ticketing.feature @@ -34,7 +34,7 @@ Feature: Event pages - Ticketing 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 select "26" from "AN_VALIDITE" And I fill in "CVVX" with "123" And I press "Valider" Then I should see "PAIEMENT ACCEPTÉ" diff --git a/tests/behat/features/MembersArea/Index.feature b/tests/behat/features/MembersArea/Index.feature index 782ac6112..5c1ed7b44 100644 --- a/tests/behat/features/MembersArea/Index.feature +++ b/tests/behat/features/MembersArea/Index.feature @@ -160,7 +160,7 @@ Feature: Espace membre, accueil When I follow "Consulter" Then I should see "Payer ma cotisation" When I follow "Télécharger la facture" - Then the response header "Content-disposition" should equal 'attachment; filename=MyCorp_COTIS-2025-200_13072018.pdf' + Then the response header "Content-disposition" should equal 'attachment; filename=MyCorp_COTIS-2026-200_13072018.pdf' @reloadDbWithTestData @clearEmails diff --git a/tests/behat/features/PublicSite/Register.feature b/tests/behat/features/PublicSite/Register.feature index 74604e4e0..22a71d100 100644 --- a/tests/behat/features/PublicSite/Register.feature +++ b/tests/behat/features/PublicSite/Register.feature @@ -48,7 +48,7 @@ Feature: Site Public - Register 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 select "26" from "AN_VALIDITE" And I fill in "CVVX" with "123" And I press "Valider" Then I should see "PAIEMENT ACCEPTÉ" @@ -87,7 +87,7 @@ Feature: Site Public - Register 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 select "26" from "AN_VALIDITE" And I fill in "CVVX" with "123" And I press "Valider" Then I should see "PAIEMENT ACCEPTÉ"