使用Makegood的Eclipse 4.2中的PHPUnit测试未运行

时间:2021-10-12 07:05:11

I have PHPUnit installed using composer and everything works as expected. I can run tests and I get the expected output.

我使用composer安装了PHPUnit,一切都按预期工作。我可以运行测试,我得到预期的输出。

This is my composer.json

这是我的composer.json

...
"require-dev": 
{
  "phpunit/phpunit": "4.1.*",
  "piece/stagehand-testrunner": ">=3.6.1" 
},
...

I then installed MakeGood 2.5 using the marketplace,

然后我使用市场安装了MakeGood 2.5,

  • Under Makegood > General I selected the preload script
  • 在Makegood> General下我选择了预加载脚本

  • The file pattern I use is 'test.php$'
  • 我使用的文件模式是'test.php $'

  • Under Makegood > PHPUnit I have given the path to the configuration file.
  • 在Makegood> PHPUnit下,我已经给出了配置文件的路径。

  • Under PHP Include Path > Libraries I have added the path to composer/vendor.
  • 在PHP Include Path> Libraries下我添加了composer / vendor的路径。

But when I select a test file and I right click and select 'Run Tests' the bootstrap file is never called. Even if I manually add 'require_once "vendor/autoload.php";' to the file, the test is not actually run.

但是当我选择一个测试文件并右键单击并选择“运行测试”时,永远不会调用引导程序文件。即使我手动添加'require_once'vendor / autoload.php“;'到文件,测试实际上没有运行。

My guess is that the script is not started properly somehow.

我的猜测是脚本没有以某种方式正确启动。

Any suggestions as to what I am doing wrong? How can I run my tests from within Eclipse using MakeGood?

关于我做错了什么的任何建议?如何使用MakeGood从Eclipse中运行我的测试?

Thanks

FFMG

1 个解决方案

#1


1  

The composer

{
    "require-dev": {
        "phpunit/php-code-coverage": "3.0.*@dev",
        "phpunit/phpunit-mock-objects": "2.3.*@dev",
        "sebastian/global-state": "1.0.*@dev",
        "phpunit/phpunit": "4.4.*@dev",
        "piece/stagehand-testrunner": "4.1.*@dev",
        "phpunit/phpunit-skeleton-generator": "2.0.*@dev"
    },
    "require": {
        "mikey179/vfsStream": "1.4.*@dev"
    }
}

As well as the latest version of makegood and everything now works as expected.
Works on Kepler and Luna

以及最新版本的makegood,现在一切都按预期工作。适用于开普勒和月神

#1


1  

The composer

{
    "require-dev": {
        "phpunit/php-code-coverage": "3.0.*@dev",
        "phpunit/phpunit-mock-objects": "2.3.*@dev",
        "sebastian/global-state": "1.0.*@dev",
        "phpunit/phpunit": "4.4.*@dev",
        "piece/stagehand-testrunner": "4.1.*@dev",
        "phpunit/phpunit-skeleton-generator": "2.0.*@dev"
    },
    "require": {
        "mikey179/vfsStream": "1.4.*@dev"
    }
}

As well as the latest version of makegood and everything now works as expected.
Works on Kepler and Luna

以及最新版本的makegood,现在一切都按预期工作。适用于开普勒和月神