[TYPO3-english] TYPO3 6, PhpStorm and unit testing

Viktor Livakivskyi invisible.kinder at gmail.com
Mon Aug 19 18:59:00 CEST 2013


Hi, list.

I'd like to use PhpStorm's feature, that allows running of unit tests and create coverage reports right from IDE.

What I've done so far: tried to make it, as described in official tutorial [1], but no luck, because it can't find TYPO3 classes, since there is no way to autoload them by Composer's autoload (I also tried to use autoload.php from EXT:/phpunit/Composer/vendor/, but no luck again).

After that I used Google and found a nice article [2], which describes steps to make PHPUnit work in PhpStorm for TYPO3, but the problem is, that 1st step is: "Configure the PHP interpreter and set the PHP home path to: /path-to-typo3-site/typo3conf/ext/phpunit/Ressources/Private/Scripts", and that file contains bash script, that runs cli_dispatch.phpsh with crafted params. And this step doesn't work, since I'm on Windows and PhpStorm is looking for *.exe file, as PHP interpreter.

Also there is an option to set a bootstrap file for PHPUnit in PhpStorm. I know about nice TYPO3 6 bootstrap process refactoring - may I somehow use it (or just a 'Core\ClassLoader') in bootstrap of PHPUnit to tell it, where core classes are located, so a problem with autoload may be solved? If yes, can you, please, show me an example of it's usage?

Did anyone faced same problem as me?


P.S.: I've also tried remote UnitTests run in PhpStorm, but this is also failed, since IDE couldn't find PHPUnit in include path for some reason.


[1]: http://confluence.jetbrains.com/display/PhpStorm/PHPUnit+Installation+via+Composer+in+PhpStorm
[2]: http://www.derhansen.de/2012/12/typo3-cms-run-extbase-unit-tests-in.html


More information about the TYPO3-english mailing list