altocompta/unit-test
Dany De Bontridder 4b0938b1f3 Task #1469 Code Cleaning: remove Anc_Account
Use a CSS with 2 fonts , one for the title and clickable item, and a
normal one.
Correct Anc_Account_Table::check duplicate for update and insert
2017-09-24 09:59:10 +02:00
..
include Task #1469 Code Cleaning: remove Anc_Account 2017-09-24 09:59:10 +02:00
bootstrap.php.example Update unit-test to new structure 2016-01-25 01:06:56 +01:00
global.example.php Task #1044 - Implementation de PHPUNIT 2014-11-09 19:19:33 +01:00
README Improve debugging and improve manage_table_sql 2017-07-23 13:24:53 +02: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

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"