How to setup HHVM for PHPUnit in PhpStorm - phpunit

How could I run my unit tests in PhpStorm 8 with HHVM as its interpreter?
PhpStorm 8 supports PHPUnit 4 which that supports HHVM and I could run my test suite on termianl with HHVM but I do not know how to config PhpStorm 8 in order to run my unit tests with HHVM.

Now by PHPStorm 8.0.2 it becomes possible:
Under the PHP setting, add a new interpreter located in /usr/bin/hhvm or /usr/local/bin/hhvm

Related

#PHPUnit Testing simple Code in this Link:https://phpunit.de/getting-started/phpunit-8.html

Hello I am new in PHPUnit and try to execute the Test Example:EmailTest by Composer, the Link is: https://phpunit.de/getting-started/phpunit-8.html
I got the text in the command_Line
$ phpunit --bootstrap vendor/autoload.php tests/EmailTest
PHPUnit 3.7.21 by Sebastian Bergmann.
Cannot open file "vendor/autoload.php".
It appears that you have different installations of PHPUnit mixed up.
For instance, you may have used Composer to install PHPUnit and have configured the autoloader generated by Composer as PHPUnit's bootstrap script but then you invoke PHPUnit using an executable other than vendor/bin/phpunit.

PhpStorm: error executing Behat tests No specifications found at path(s) but works from command line

I'm using PhpStorm and Vagrant to develop a Symfony project.
I configured PhpStorm to execute Behat tests with the Vagrant machine but when I try to run or debug them I got this error:
vagrant:///Users/jose/Documents/WWW/symfony_project/usr/bin/php /home/vagrant/.phpstorm_helpers/behat.php --format PhpStormBehatFormatter --config /var/www/symfony/behat.yml /var/www/symfony/features/api/brand/full_rest.feature:13
Testing started at 10:48 ...
0 scenario0 step0m0.05s (14.76Mb)
[Behat\Testwork\Tester\Exception\WrongPathsException]
No specifications found at path(s) `/var/www/symfony/features/api/brand/full_rest.feature:13`. This might be because of incorrect paths configuration in your `suites`.
Although if I execute it from the command line inside the Vagrant machine it works OK:
./vendor/bin/behat --config /var/www/symfony/behat.yml /var/www/symfony/features/api/brand/full_rest.feature:13
#brands #api
Feature: API to manage the brands
As a frontend app
.......
I've configured the PHP Interpreter with my Vagrant VM and I also think the Behat configuration is set OK: I see the Behat version, I've set the behat config path... I don't understand why the execution from PhpStorm fails.
Any ideas? Thanks in advance
This a bug in behat 3.4.0 breaks the ability to run individual tests
Try to switch back to "behat/behat": "3.3.1".

PhpStorm with PHPUnit: PHP_CodeCoverage_Filter not found

I am trying to use PHPUnit in PhpStorm (on a Mac). Therefore I tried adding the pear path and phpunit path to the include path of PhpStorm (the ones I found through which pear on the command line) - it tells me that phpunit was not found.
I also tried to use PHPUnit with the custom autoloader generated by composer (the phpunit package is installed), I then receive another error:
Fatal error: Class 'PHP_CodeCoverage_Filter' not found
If I run phpunit on the console normally everything works:
phpunit --bootstrap vendor/autoload.php tests/*Test.php
What am I doing wrong?
The problem was that I used the default php interpreter which phpStorm suggested to me. This was version PHP 5.5 though and not the 5.6 version in my terminal.
After changing the interpreter to an up-to-date php version (5.6 or 7.0) it worked with the PHAR Option.

PhpUnit - Xdebug does not stop on breakpoints in tests

I am using Xdebug to remote-debug a Symfony application that is running in a VM. Xdebug works without any problems when debugging HTTP requests, but I am having a problem debugging PhpUnit tests. My CLI Xdebug configuration is:
# /etc/php5/cli/conf.d/20-xdebug.ini
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_host=10.0.2.2
xdebug.remote_log=/home/vagrant/xdebug-cli.log
When I run phpunit, the connection to my IDE (PhpStorm) is successfully created, and I can see that it stops on line 3 (the first executable line) of the PhpUnit PHAR, but the debugger never appears to enter my tests and does not stop on breakpoints that I place in them, even though my tests are in fact being run.

Behat tests fail at random

I test my Symfony2 project with PHPUnit and behat/mink. This morning I added more behat tests to my project and all of a sudden random tests started failing. It seems like I hit a limit (memory? execution time? something else?) but I can't find anything.
Travis-ci does not fail on this http://travis-ci.org/#!/tvlooy/ReadingCorner/builds/383016
My local machine does fail (Lenovo R60, 2GB RAM, 2x 1.8Ghz CPU). I run Fedora 16 on x86, 32bit. PHP 5.3.8 (cli), with Xdebug v2.1.2, PHPUnit 3.6.2.
(edit: I just updated to PHPUnit 3.6.4 and removed Xdebug but the problem remains)
I run my Behat tests with:
$ app/console behat -e=test
=> random tests fail
When I run the tests like this:
$ for feature in 'find src/Ctors/ReadingCornerBundle/Features/ -name *.feature'; do app/console behat -e=test $feature; done
=> all tests pass
I already raised my memory_limit in php.ini to 768M but it didn't help.
I have 7 feature files with a total of 57 scenario's. Not much, nothing exotic. The files are in https://github.com/tvlooy/ReadingCorner/tree/master/src/Ctors/ReadingCornerBundle/Features
I need the tests to work on my local machine in one command because I generate code coverage from it with PHPUnit (wrapped behat features in PHPUnit).
Any clues?
#jakub_zalas blogged about a fix. See http://www.zalas.eu/fixing-failing-behat-scenarios-in-large-suites
Setting 1002: 'SET SESSION wait_timeout=30;' fixed it for me too.
Please, run your features with -v and gist the output

Resources