1
votes

For development and debugging I use the combination Zend Studio 12 + Xdebug. The projects are stored on a Windows 7 local machine, shared with as shared folders with a Linux Virtualbox VM, and executed there. It's my environmnet looks like.

The debugging works and I can also debug (vendor) libraries within a "common" project. But if the IDE project is a library or a container with multiple libraires, it doesn't have 1. a URL (like my-project.loc) and 2. an index file. I've faked the URL and the index.php:

enter image description here

but it's not working.

How to get Xdebug working with Zend Studio for PHPUnit code in the context of a library / container IDE project?

1

1 Answers

1
votes

The mappings for PHPUnit of every library needed to be set up, then it worked.

Window -> Preferences -> PHP -> Servers -> [entry] my-server-name -> [button] Edit -> [tab] Path Maping:

enter image description here

/var/www/my-project                                     /my-project
/usr/local/lib/phpunit-4.8.phar/phar/phpunit/Framework  /my-project/path/to/library-foo/vendor/phpunit/php-code-coverage/tests
/usr/local/lib/phpunit-4.8.phar/phar/phpunit            /my-project/path/to/library-bar/vendor/phpunit/phpunit/src

All these mapping entries has been created by the IDE, after I called

require_once './path/to/foo/test/Bootstrap.php';

in the /index.php.

Don't know, why the library foo has got the mapping for the code coverage (and the other one not) and why the library bar has got the mapping for PHPUnit source (and the other one not). (It would be nice, if someone could explain that.) But anyway -- it works.