MakeGood 似乎不适用于 Indigo (3.8) 之后的版本。
MakeGood 在 Indigo 中生成的示例命令行:
/usr/bin/php -c /tmp/zend_debug/session5741147879914839410.tmp/php.ini -d asp_tags=off -d short_open_tag=on /home/dev/.eclipse/org.eclipse.platform_3.8_155965261/plugins/com.piece_framework.makegood.stagehandtestrunner_2.5.0.v201311031709/resources/php/bin/testrunner.php --no-ansi phpunit -p /home/dev/workspace/Acme/app/bootstrap.php.cache --log-junit=/tmp/com.piece_framework.makegood.launch/MakeGood1399206591471.xml --log-junit-realtime --phpunit-config=/home/dev/workspace/Acme/app/phpunit.xml.dist -R --test-file-pattern=Test(?:Case)?\.php$ /home/dev/workspace/Acme/src/Yuav/AcmeBundle/Tests
在朱诺/开普勒/月球:
/usr/bin/php -c /tmp/zend_debug/session3820024215614976335.tmp/php.ini -d asp_tags=off -d short_open_tag=on /home/dev/workspace/Acme/src/Yuav/AcmeBundle/Tests/Controller/JobControllerTest.php --no-ansi phpunit -p /home/dev/workspace/Acme/app/bootstrap.php.cache --log-junit=/tmp/com.piece_framework.makegood.launch/MakeGood1399206154221.xml --log-junit-realtime --phpunit-config=/home/dev/workspace/Acme/app/phpunit.xml.dist -R --test-file-pattern="Test(?:Case)?\.php$" /home/dev/workspace/Acme/src/Yuav/AcmeBundle/Tests
如您所见,从不调用 testrunner.php - 无论是否定义了引导程序,都不会触发它。
特别是对于您的错误,我猜这是您的自动加载器没有触发,因为缺少引导
您可以通过将 php 可执行文件设置为 bash 脚本硬编码 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