Tests unitaires par jalon (J1→J3) et Tests de Non-Régression par version. Objectif couverture ≥ 80 %.
| Jalon | Fichier | Classe testée | Tests | Périmètre | Statut |
|---|---|---|---|---|---|
| J1.1 | ProjectTest.php |
Project (Model) | 22 | Casting, calcul pourcentage, scopes, expiration, acceptsInvestment(), validation | Passant |
| J1.2 | InvestisseurTest.php |
Investisseur (Model) | 14 | full_name accessor, canInvest(), plafond diaspora/résident, isDiaspora(), KYC gates | Passant |
| J1.3 | KycTest.php |
KycService | 13 | calculateRiskScore() (0–100), MIME validation, PPE/sanctions blocage, shouldAutoValidate() | Passant |
| J1.4 | PortefeuilleTest.php |
Portefeuille (Model) | 10 | Valeur totale, rendement annualisé, % par catégorie (somme = 100%), alerte concentration | Passant |
| J1.5 | AuthTest.php |
Auth / Credentials | 10 | Hachage bcrypt, rejet mot de passe faible, vérification credentials Admin XAMPP | Passant |
| J2.1 | PaiementTest.php |
PaiementService | — | Initiation Stripe/Wave/OM/MTN, webhooks, réconciliation, remboursements | Planifié |
| J2.2 | MarketplaceTest.php |
MarketplaceService | — | Création offre, plafond 200%, commission 1%, flow achat/vente | Planifié |
| J3.1 | NotificationTest.php |
NotificationService | — | Email SendGrid, SMS Twilio, push web, file de diffusion newsletter | Planifié |
| Transition | Fichier | Tests | Périmètre | Statut |
|---|---|---|---|---|
v0.1 → v1.0 |
AuthFlowTest.php |
12 | Inscription, login, logout HTTP, rate-limit 429, utilisateur non-vérifié bloqué, 2FA | Passant |
v0.1 → v1.0 |
ProjectFlowTest.php |
14 | Parcours projets, filtres catégorie/pays/tri, détail, brouillon invisible, soumission, validation/rejet admin | Passant |
v0.1 → v1.0 |
InvestissementFlowTest.php |
15 | Gate KYC, montant minimum, plafond, projet clôturé/brouillon/expiré rejeté, portfolio, mise à jour collecte | Passant |
v0.1 → v1.0 |
KycFlowTest.php |
13 | Upload fichier (Storage::fake), MIME rejeté, taille rejetée, doublon pending, validation/rejet admin, resoumission | Passant |
v1.0 → v1.5 |
MarketplaceFlowTest.php |
11 | Création offre, offre d'autrui bloquée, prix > 200% rejeté, achat, offre propre bloquée, commission 1%, annulation | Passant |
v1.0 → v1.5 |
PaiementFlowTest.php |
— | Initiation paiement, simulation webhook Stripe/Wave/OM/MTN, confirmation investissement, remboursement | Planifié |
v1.5 → v2.0 |
ForumFlowTest.php |
— | Création topic, réponse, modération, like, signalement, fil d'actualité projet | Planifié |
v2.0 → v3.0 |
MultideviseFlowTest.php |
— | Conversion XOF/GHS/NGN, taux de change API, arrondi réglementaire, affichage localisé | Planifié |
v2.0 → v3.0 |
MobileApiTest.php |
— | Endpoints API /api/v1, auth Sanctum token, rate-limit, versioning, Flutter integration tests | Planifié |
# Tous les tests php artisan test # Tests unitaires uniquement php artisan test --testsuite=Unit # Tests de non-régression uniquement php artisan test --testsuite=Feature # Avec rapport de couverture HTML php artisan test --coverage --coverage-html=coverage-report/ # Avec minimum de couverture (CI/CD) php artisan test --coverage --min=80 # Un seul fichier de tests php artisan test tests/Unit/KycTest.php # Filtre par nom de méthode php artisan test --filter testRiskScoreHighCountry