Configuring PHPUnit in Komodo 10

One other thing I have discovered is that I had to do the same ‘trick’ as I mentioned in another thread to get PHPUnit working.

Just saying - you have to modify the include_path setting of the ini that Komodo uses.

Weird… I’m still getting this:

PHP Warning:  require_once(phpunit.phar): failed to open stream: No such file or directory in /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/Base/HarnessSelector.php on line 11
PHP Stack trace:
PHP   1. {main}() /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/drive_testrunner.php:0
PHP   2. PHPUnitXt_Utils_Loader::load() /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/drive_testrunner.php:12
PHP   3. require_once() /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/Utils/Loader.php:20
PHP   4. PHPUnitXt_Utils_Loader::load() /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/Ko/HarnessSelector.php:11
PHP   5. require_once() /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/Utils/Loader.php:20
Warning: require_once(phpunit.phar): failed to open stream: No such file or directory in /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/Base/HarnessSelector.php on line 11
Call Stack:
    0.0002     226408   1. {main}() /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/drive_testrunner.php:0
    0.0011     264112   2. PHPUnitXt_Utils_Loader::load() /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/drive_testrunner.php:12
    0.0014     274560   3. require_once('/Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/Ko/HarnessSelector.php') /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/Utils/Loader.php:20
    0.0014     274608   4. PHPUnitXt_Utils_Loader::load() /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/Ko/HarnessSelector.php:11
    0.0017     296160   5. require_once('/Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/Base/HarnessSelector.php') /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/Utils/Loader.php:20
PHP Fatal error:  require_once(): Failed opening required 'phpunit.phar' (include_path='/Users/markoxley/.phpunit/src/Framework') in /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/Base/HarnessSelector.php on line 11
PHP Stack trace:
PHP   1. {main}() /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/drive_testrunner.php:0
PHP   2. PHPUnitXt_Utils_Loader::load() /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/drive_testrunner.php:12
PHP   3. require_once() /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/Utils/Loader.php:20
PHP   4. PHPUnitXt_Utils_Loader::load() /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/Ko/HarnessSelector.php:11
PHP   5. require_once() /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/Utils/Loader.php:20
Fatal error: require_once(): Failed opening required 'phpunit.phar' (include_path='/Users/markoxley/.phpunit/src/Framework') in /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/Base/HarnessSelector.php on line 11
Call Stack:
    0.0002     226408   1. {main}() /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/drive_testrunner.php:0
    0.0011     264112   2. PHPUnitXt_Utils_Loader::load() /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/drive_testrunner.php:12
    0.0014     274560   3. require_once('/Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/Ko/HarnessSelector.php') /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/Utils/Loader.php:20
    0.0014     274608   4. PHPUnitXt_Utils_Loader::load() /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/Ko/HarnessSelector.php:11
    0.0017     296160   5. require_once('/Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/Base/HarnessSelector.php') /Applications/Komodo IDE 10.app/Contents/Resources/python/komodo/harnesses/php/Utils/Loader.php:20

But if I place phpunit.phar into the harnesses/php/Base folder it works

http://community.komodoide.com/t/feedback-on-komodo-ide-v10-lets-get-started/2663/21?u=defman

@Mark_Oxley I’ve tweaked the loader a bit so it will look for phpunit.phar in $PATH variable as well.

Add set_include_path(get_include_path() . PATH_SEPARATOR . getenv("PATH")); after <?php in %komodo%/lib/mozilla/python/komodo/harnesses/php/Base/HarnessSelector.php

Awesome, that did the trick.
Will this become standard in future releases, or will I need to amend this file each update?

This could become standard in 10.1 if @mitchell will apply my patch.

But unless Komodo will touch this file, you don’t have to change it on each upgrade.