2

I want to use the Eclipse plugin "makegood" to use php-unit-tests in Eclipse. When I'm running phpunit on console, everything is working.

I followed the following instruction to set up the makegood-plugin in Eclipse: http://www.stuermer-benjamin.de/v12_1/eclipse-4-2-with-php-android-and-unit-testing/

The status of makegood is "Waiting for a test run...", but when I try to run a unit-test, I get this error printed in the console:

Fatal error: Class
> 'Stagehand\TestRunner\CLI\TestRunnerApplication\Command\CommandRepository'
> not found in C:\Users\myNameWith18Charac
> \.eclipse\org.eclipse.platform_4.3.0_1709980481_win32_win32_x86_64\plugins\com.piece_framework.makegood.stagehandtestrunner_2.5.0.v201311031709\resources\php\php\Stagehand\TestRunner\CLI\TestRunnerApplication\Application.php
> on line 64
> 
> Call Stack:
>     0.0000     148336   1. {main}() C:\Users\myNameWith18Charac\.eclipse\org.eclipse.platform_4.3.0_1709980481_win32_win32_x86_64\plugins\com.piece_framework.makegood.stagehandtestrunner_2.5.0.v201311031709\resources\php\bin\testrunner.php:0
>     0.0100     460744   2. Stagehand\TestRunner\CLI\TestRunnerApplication\Application->__construct()
> C:\Users\myNameWith18Charac\.eclipse\org.eclipse.platform_4.3.0_1709980481_win32_win32_x86_64\plugins\com.piece_framework.makegood.stagehandtestrunner_2.5.0.v201311031709\resources\php\bin\testrunner.php:58

The class Stagehand\TestRunner\CLI\TestRunnerApplication\Command\CommandRepository is existing!

Is the path maybe too long? But I don't know, how to change it. I'm using win7 x64.

Wolfgang Fahl
  • 15,016
  • 11
  • 93
  • 186

1 Answers1

1

I'm seeing the same thing in Ubuntu, running Eclipse Kepler and PDT 3.3.

Enabling debug in MakeGood, I can see that the command that's actually being run is php with a single argument of the file I'm currently viewing (E.G the test).

It simply doesn't work as advertised, as it's just trying to execute the file on its own.

Downgrading to Eclipse 3.8 (Juno), and PDT 3.0.0 worked for me.

*Edit:

You can define a custom bash script as the php executable as a workaround, and hardcode the path to testrunner.php

#!/bin/bash
# MakeGood for PHP stopped working after Eclipse Indigo (3.8) due to inability to run testrunner.php
# This is a hack PHP binary, to be configured as PHP executable for MakeGood to start working in Juno, Kepler and Luna.

# Remove the -n operator to read all config files
options=`echo $@ | sed 's%-n %%' | sed 's%-c .+? %%'`

# Hardcode path to testrunner.php
options=`echo $options | sed 's@open_tag=on [^ ]*@open_tag=on /opt/testrunner.php

/usr/bin/php $options
Jon Skarpeteig
  • 4,118
  • 7
  • 34
  • 53