How to debug PHP test files in Netbeans

When I right-click> Debug file, the test succeeds, but Netbeans can connect to xdebug. I can confirm that debugging works in a regular Debug project.

Is it even possible to debug a test file? If not, are there any alternatives? Thank you

+6
source share
3 answers

If you need to debug a separate file, you need to select Debug File (CTRL + SHIFT + F5) instead of Debug Main Project (CTRL + F5).

+2
source

I copied the xdebug options from the apache2 / php.ini file to my cli / php.ini (command line interface).

The path to the file on ubuntu 10.04, set using apt-get, is /etc/php5/cli/php.ini .

My cli / php.ini file now has the following settings:

 xdebug.remote_enable=On xdebug.remote_handler=dbgp xdebug.remote_host=localhost xdebug.remote_port=9000 xdebug.idekey=netbeans-xdebug xdebug.remote_mode=req 

Then I can right-click on the test file and select Debug (shortcut CTRL + SHIFT + F5 )

+2
source

I assume that you are working with an IDE with PHPUnit.

To simplify connecting xdebug to NetBeans PHP IDE, I suggest you use EasyPHP. I use it and can debug my tests using the IDE version 7. Just 1) open the test file, 2) call Menu - Debug - Debug File , as holodoc pointed out.

Hi,

Us

+1
source

Source: https://habr.com/ru/post/893981/


All Articles