0

Zend Studio 10.6.1 on Windows 8.1:

How to run PHPUnit Selenium inside Zend Studio (Version 10.6.1)? Zend Studio 10.6.1 has a built-in version of PHPUnit 3.7, but no phpunit-selenium package installed. I tried installing phpunit-selenium in my PHP project, without success.

  • installed as a phar archive (phpunit.phar downloaded from phpunit website).
  • installed with composer in my PHP project (require: phpunit-selenium >= 1.3.3).
  • unpacked the phar archive and including it in my project.
  • installed a complete current PHPUnit package (Version 4.1) in my project.

The effects were that either the PHPUnit Selenium classes could not be found, or that the tests would not run, or that PHPUnit didn't run at all anymore from within Zend Studio.

I'll answer this question by describing how I worked around it to get it to work finally.

Oliver Konig
  • 1,035
  • 2
  • 14
  • 17
  • Why did you post your question here? Even though you know the answer. You posted question and answered it at the same minute. You should ask question only if you really don't know answer. – Alpha May 08 '14 at 10:19
  • When posting a question, one can answer it oneself. The reason is that others who have a similar problem can find this. – Oliver Konig May 08 '14 at 14:18

1 Answers1

0

A clean solution would be to edit composer.json in the built-in PHPUnit of Zend Studio. The path to the built-in PHPUnit of Zend Studio under Windows is:

c:\Program Files (x86)\Zend\Zend Studio 10.6.1\plugins\com.zend.php.phpunit_10.6.1.v20140329-2132\resources\vendor\phpunit\phpunit

and / or:

c:\Program Files (x86)\Zend\Zend Studio 10.6.1\plugins\com.zend.php.phpunit_10.6.1.v20140329-2132\resources\vendor\phpunit\phpunit.org

There seem to be two identical versions.

However, after some dabbling around with composer, I couldn't manage to resolve the error messages, and gave up on it. I hope this can be solved in the future because it would be the cleaner solution.

Here is a successful Workaround:

  • install phpunit-selenium via composer in project;
  • copy the files over to the built-in PHPUnit of Zend Studio;
  • edit the file vendor\composer\autoload_classmap.php under the project directory:
    • find the lines that start with 'PHPUnit_Extensions_Selenium' and copy them to clipboard;
  • edit the file c:\Program Files (x86)\Zend\Zend Studio 10.6.1\plugins\com.zend.php.phpunit_10.6.1.v20140329-2132\resources\vendor\composer\autoload_classmap.php:
    • paste in the copied lines that start with 'PHPUnit_Extensions_Selenium';
  • remove phpunit-selenium from composer in project and from project;
Oliver Konig
  • 1,035
  • 2
  • 14
  • 17