Automatic testing in NetBeans

Z Freenetis Wiki
Verze z 7. 6. 2014, 15:13, kterou vytvořil Sivosha (diskuse | příspěvky) (Založena nová stránka: cs:Automatické testování v NetBeans ru:Автоматизированное тестирование в NetBeans == Integration of PHPUnit into NetBeans == ===...)
(rozdíl) ← Starší verze | zobrazit aktuální verzi (rozdíl) | Novější verze → (rozdíl)
Přejít na: navigace, hledání


Integration of PHPUnit into NetBeans

Installing packages

in Ubuntu/Debianu:

sudo apt-get install phpunit

in Fedora:

sudo yum install phpunit


Setting NetBeans

Enter the path to PHPUnit (/usr/bin/PHPUnit) manually or using the Search window

Tools> Preferences> PHP> Unit Testing


== Creating tests ==

In the context menu of the test source file/folder, select

Tools> Create PHPUnit tests

Enter the path to the folder (the folder is in the root directory of tests FreenetIS). The test files will be automatically generated there. This this is a basis for creating tests selected file. In this file naimplementujte tests for each method.


Running tests

In the Project Properties window, enable PHPUnit Use Bootstrap and Use Bootstrap for Creating New Unit Tests as a Bootstrap file, select index.php in the root directory FreenetIS.

In the context menu of the source file that you want to test, select Test. Or in the Run menu select Test project. Then it will automatically check all of the tests and view the results in the Test Results window.