réponses
84 vues
Laravel Tests: commande php
Hello a tous. J'ai un souci avec la commande pour effectuer les tests laravel d'un répertoire de mon dossier Test sauf un répertoire bien precis. Sur mes recherches je suis tombé sur la cet commande php artisan test --exclude-testsuite=Unit/nom_repertoire --exclude-testsuite=Feature/nom_repertoire
comme retour sur erreur j'ai obtenu --exclude-testsuite n'est connu de php unit
Essaie de faire
1php artisan test --exclude-group=nom_du_repertoire1php artisan test --exclude-group=nom_du_repertoire
Execute la commande suivante pour exclure un dossier de l'execution des tests en utilisant PHPUnit
1vendor/phpunit/phpunit/phpunit --exclude-testsuite=test_suite_name1vendor/phpunit/phpunit/phpunit --exclude-testsuite=test_suite_name
Pour configurer ajouter des testsuites ou modifier des testsuites, cela est possibles dans le fichier phpunit.xml
ajouter vos modifications dans la sections testsuites Par défaut
1<testsuites>2 <testsuite name="Unit">3 <directory>tests/Unit</directory>4 </testsuite>5 <testsuite name="Feature">6 <directory>tests/Feature</directory>7 </testsuite>8 </testsuites>1<testsuites>2 <testsuite name="Unit">3 <directory>tests/Unit</directory>4 </testsuite>5 <testsuite name="Feature">6 <directory>tests/Feature</directory>7 </testsuite>8 </testsuites>
En somme par défaut l'on pourrais exécuter la commande suivante pour exclure les test unitaires
1vendor/phpunit/phpunit/phpunit --exclude-testsuite=Unit1vendor/phpunit/phpunit/phpunit --exclude-testsuite=Unit
superb j'ai trouver une autre facon de faire.
j'ai d'abord configurer la fichier PhpUnit
1<testsuites>2 <testsuite name="Feature">3 <directory suffix="Test.php">4 ./tests/Feature5 </directory>6 <!-- Exclure le répertoire workflow_apps -->7 <exclude>8 <directory suffix="Test.php">./tests/Feature/nom_repertoire</directory>9 </exclude>10 </testsuite>11 <testsuite name="Unit">12 <directory suffix="Test.php">13 ./tests/Unit14 </directory>15 <!-- Exclure le répertoire workflow_apps -->16 <exclude>17 <directory suffix="Test.php">./tests/Unit/nom_repertoire</directory>18 </exclude>19 </testsuite>1<testsuites>2 <testsuite name="Feature">3 <directory suffix="Test.php">4 ./tests/Feature5 </directory>6 <!-- Exclure le répertoire workflow_apps -->7 <exclude>8 <directory suffix="Test.php">./tests/Feature/nom_repertoire</directory>9 </exclude>10 </testsuite>11 <testsuite name="Unit">12 <directory suffix="Test.php">13 ./tests/Unit14 </directory>15 <!-- Exclure le répertoire workflow_apps -->16 <exclude>17 <directory suffix="Test.php">./tests/Unit/nom_repertoire</directory>18 </exclude>19 </testsuite>
ensuite j'ai taper cet commande et c'est ok:
1php artisan test --configuration=phpunit.xml1php artisan test --configuration=phpunit.xml
Il faut Se connecter ou Créer un compte pour participer à cette conversation.