PHPUnit Debug Configurations don't work Zend Studio 13.6

General discussion on Zend Studio

PHPUnit Debug Configurations don't work Zend Studio 13.6

Postby marketacumen on Thu May 04, 2017 7:20 pm

I'm trying to run a PHPUnit test against my code using the Debug Configurations with a phpunit.xml in Zend Studio 13.6 on macOS Sierra 10.12.4 running on a Mac Pro. I'm running the latest Zend Server with PHP 7 support. PHPUnit is the latest version which only runs with PHP 7.

The problem is I configure my test simply, but when I try to run it, it fails immediately with the following error:

Class '/Users/kent/ma/myproject/test/My_Test' could not be found in '/Users/kent/ma/myproject/test/My_Test.php'.

The PHPUnit test is configured as follows:

Elements to test:
Run a single test (checked)
Project: myproject
Test class: My_Test

Additional parameters:
Collect Code Coverage statistics (unchecked)
Generate an XML (JUnit format) report (unchecked)
PHPUnit Configuration: phpunit.xml (at root of project)

I have tried "Use global PHPUnit Phar" which results in the error above in the "Debug Output":

Class '/Users/kent/ma/myproject/test/My_Test' could not be found in '/Users/kent/ma/myproject/test/My_Test.php'.

Or if I try the "Use project's PHPUnit (Composer)" I get this error:

Fatal error: Class 'PHPUnit_Util_Printer' not found in /private/var/folders/f3/d7f6t5bd6x55n9k7gl__shdw0000z_/T/zendprinter/ZendPHPUnitLogger.php on line 3

Which is due to the fact that the stub generated uses PHPUnit prior to the latest version which is only compatible with version 7.

e.g that file contains

class ZendPHPUnitLogger extends PHPUnit_Util_Printer implements PHPUnit_Framework_TestListener
{
...

PHPUnit as installed by composer is:

phpunit/phpunit 6.1.2 The PHP Unit Testing framework.

I can configure tests to run via the command line and debug those, but would rather use the internal framework by Zend. Any help would be appreciated.
No whining.
marketacumen
 
Posts: 16
Joined: Thu Jul 15, 2010 9:03 pm

Re: PHPUnit Debug Configurations don't work Zend Studio 13.6

Postby mich6938 on Tue May 16, 2017 9:23 am

Hi
Sorry for delayed response. It looks that Studio 13.6 has a problem with new PHPUnit API. It will be fixed in maintenance release but I cannot give you ETA right now. If PHPUnit version isn't a critical thing for you please use older version e.g. 5.3. If this isn't an option let us know and we will think about a different solution. I'm sorry for an inconvenience.
mich6938
Zend Product Manager
 
Posts: 352
Joined: Wed Jul 16, 2014 12:32 pm


Return to Zend Studio

Who is online

Users browsing this forum: No registered users and 4 guests