【问题标题】:MakeGood-Error with PhpUnit in EclipseEclipse 中 PhpUnit 的 MakeGood-Error
【发布时间】:2015-12-28 00:29:15
【问题描述】:

我想使用 Eclipse 插件“makegood”在 Eclipse 中使用 php-unit-tests。当我在控制台上运行 phpunit 时,一切正常。

我按照以下说明在 Eclipse 中设置 makegood-plugin:http://www.stuermer-benjamin.de/v12_1/eclipse-4-2-with-php-android-and-unit-testing/

makegood 的状态是“Waiting for a test run...”,但是当我尝试运行单元测试时,我在控制台中打印了这个错误:

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

Stagehand\TestRunner\CLI\TestRunnerApplication\Command\CommandRepository 类已存在!

路径可能太长了吗?但是不知道怎么改。我用的是win7 x64。

【问题讨论】:

    标签: eclipse phpunit makegood


    【解决方案1】:

    我在运行 Eclipse Kepler 和 PDT 3.3 的 Ubuntu 中看到了同样的情况。

    在 MakeGood 中启用调试,我可以看到实际运行的命令是 php,带有我当前正在查看的文件的单个参数(例如测试)。

    它根本不像宣传的那样工作,因为它只是试图自己执行文件。

    降级到 Eclipse 3.8 (Juno) 和 PDT 3.0.0 对我有用。

    *编辑:

    您可以将自定义 bash 脚本定义为 php 可执行文件作为解决方法,并将 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
    

    【讨论】:

      猜你喜欢
      • 2014-04-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-11
      • 1970-01-01
      • 2010-11-01
      相关资源
      最近更新 更多