Allgemein, Arbeit

Unit tests for SF2 with IntelliJ / PHPStorm and Vagrant

you require a working Symfony instance running through Vagrant.

Prerequisites

1) Install Remote Interpreter

remote_php

2) Add a Remote PHP Interpreter.

use vagrant ssh-config to get required information

Screen Shot 2016-02-17 at 14.11.57

3) Setup Path Mapping (Deployment Server)

Screen Shot 2016-02-17 at 14.47.11

 

4) Setup PHPUnit

Screen Shot 2016-02-18 at 00.04.27.png

create a file in app/phpunit.php and use it as a custom loader for phpunit:

<?php

if (!defined('PHPUNIT_COMPOSER_INSTALL')) {
    define('PHPUNIT_COMPOSER_INSTALL', __DIR__ . '/autoload.php');
}

require_once 'autoload.php';

this allows you to use @runInSeparateProcess till https://youtrack.jetbrains.com/issue/WI-29458 is fixed

 

 

Now everything should be setup and you can run the tests in Vagrant🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s