altocompta/unit-test/README
Dany De Bontridder a5ef1138a4 Improve debugging and improve manage_table_sql
element will be added at the right place
Manage_Table_SQL can work also with a SQL query or a view
Icon place can be modified
2017-07-23 13:24:53 +02:00

29 lines
1.6 KiB
Text

Ce répertoire sert aux tests unitaires avec PHPUNIT, il faut d'abord changer dans le bootstrap.php pour que le path soit correct.
Il faut configurer Netbeans pour pouvoir l'utiliser :
1 . Activer PHPUNIT,
2 . dans GLOBAL PATH (propriété du projet) ajouter le fichier phpunit.phar
3. Donner unit-test comme répertoire de test
Ensuite copier bootstrap.php.example vers bootstrap.php et modifier les variables (le dossier à utiliser, include_path ...)
Testing commande en ligne
=========================
Génération
php <chemin>/phpunit-skelgen.phar --bootstrap bootstrap.php --test -- Intervat ../include/class_transform_intervat.php
ou
php <chemin>/phpunit-skelgen.phar generate-test --bootstrap bootstrap.php -- Acc_Account_Ledger ../include/class/class_acc_account_ledger.php
test (depuis repertoire include)
php <chemin>/phpunit.phar --tap --colors --bootstrap ../bootstrap.php class_acc_accountTest.php
Tous les fichiers
for i in *.php;do php <chemin>/phpunit.phar --tap --colors --bootstrap ../bootstrap.php $i;done
Génération pour tous les fichiers
=================================
Permet de voir les lignes de code qui ont été testées
php <chemin>/phpunit.phar --coverage-html html --bootstrap bootstrap.php include
exemple depuis NETBEANS "/usr/bin/php" "/home/dany/Program/phpunit-skelgen.phar" "--ansi" "generate-test" "--bootstrap=/home/dany/developpement/phpcompta/noalyss/unit-test/bootstrap.php" "View_SQL" "/home/dany/developpement/phpcompta/noalyss/include/lib/view_sql.class.php" "View_SQLTest" "/home/dany/developpement/phpcompta/noalyss/unit-test/include/lib/view_sql.classTest.php"