altocompta/unit-test
2021-06-07 15:16:46 +02:00
..
db PHPUNIT : add test folder 2019-09-29 21:51:52 +02:00
document/fr_be Unit test : update 2021-05-17 12:54:21 +02:00
include ocument : add phpunit test 2021-06-07 15:16:46 +02:00
bootstrap.php.example TEST : add new files 2019-11-02 00:56:45 +01:00
create-dossier-test.sh ocument : add phpunit test 2021-06-07 15:16:46 +02:00
facility.class.php Improve PHPUNIT test 2019-11-17 21:35:23 +01:00
global.example.php Task #0001869: Session key : clef de session 2020-12-22 20:38:16 +01:00
global.php Document : add phpunit test 2021-06-07 15:01:00 +02:00
jrn.csv TEST : add new files 2019-11-02 00:56:45 +01:00
README Improve PHPUNIT Test for phpunit7 and phpunit8 2019-09-19 14:22:34 +02:00
test-file.sh Improve PHPUNIT test 2019-11-17 21:35:23 +01:00

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

Global.php
==========

Donner le dossier
$_REQUEST['dossier']

Utilisateur pour Noalyss
$_SESSION['g_user']='phpcompta';

Mot de passe  pour g_user
$_SESSION['g_pass']='dany';

Bootstrap
=========
Ensuite copier bootstrap.php.example vers bootstrap.php et modifier les variables (le dossier à utiliser, include_path ...)


Testing commande en ligne
=========================

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"

Note développeur
================
Pour avoir tous les fichiers à inclure
--------------------------------------
Depuis ici, faites

cd ../include 

find class lib -type f | awk '{print "require_once NOALYSS_INCLUDE.--/"$1"--;";}'|sed -e 's/--/"/g' >> ../unit-test/bootstrap.php