使用 Eclipse SimpleTest 插件 - SimpleTest 不起作用

发布于 2024-08-05 06:37:24 字数 733 浏览 9 评论 0 原文

我正在使用 Eclipse 3.4.2 并使用“帮助”>“软件更新”安装了最新的 simpletest 插件...

该插件安装正确,并且我能够在“窗口”>“首选项”>“SimpleTest”中进行设置。 我已填写以下字段:Php.exe 文件、php.ini 文件和测试文件后缀。我无法找到 simpletest 路径(甚至在 Eclipse Plugin 文件夹中也找不到)。

我认为这个配置是正确的,并运行了在 simpletest eclipse 站点上找到的第一个测试: http:// simpletest.sourceforge.net/en/extension_eclipse.html

<?php
class test1 extends UnitTestCase {
  function test_pass(){
    $x = 1;
    $y = 2;
    $total = $x + $y;
    $this->assertEqual(3,$total, "This should pass");
  }
}
?>

我一直在遵循所有说明,但是当我右键单击并选择 RUN AS>SimpleTest 时,没有任何反应。

我需要一些帮助。

谢谢你!

I'm using Eclipse 3.4.2 and installed the latest plug-in for simpletest using Help>Software Updates...

The plugin installed correctly and I was able to set it up in Window>Preferences>SimpleTest.
I have filled in the following fields : Php.exe file, php.ini file, and test file Suffix. I was not able to find the simpletest Path (not even inside the Eclipse Plugin folder).

I figure this configuration was correct and ran the first test found on the simpletest eclipse site : http://simpletest.sourceforge.net/en/extension_eclipse.html

<?php
class test1 extends UnitTestCase {
  function test_pass(){
    $x = 1;
    $y = 2;
    $total = $x + $y;
    $this->assertEqual(3,$total, "This should pass");
  }
}
?>

I have been following all the instructions but when I do right click and select RUN AS>SimpleTest, nothing happens.

I need some help with this.

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笑忘罢 2024-08-12 06:37:24

根据 simpletest 插件的作者

该插件已经不再有用(或者更确切地说,工具集现在可以更轻松地提供该功能)。

他本人不再使用它了。相反,他使用以下过程

  1. 下载并安装 SimpleTest
  2. require_once('autorun.php'); 放在测试文件的顶部

    注意:这需要包含 autorun.php 的 SimpleTest 目录位于您的 include_path。或者,您可以通过完整路径包含 autorun.php,例如 require_once('C:/full/path/to/your/Simpletest/autorun.php');。甚至可能不必通过 autorun.php 来更改测试文件rel="noreferrer">auto_prepend_file.

  3. 通过右键单击测试文件并选择“Run As PHP Script”来运行测试,
  4. 测试的输出再次显示在 Eclipse 控制台中

根据作者的说法,

这比插件更容易配置并且运行速度更快。以这种方式运行的另一个好处是,如果您想调试测试,当您右键单击测试文件时,可以单击“调试为 PHP 脚本”而不是“运行为”。

according to the author of the simpletest plugin,

the plugin has outlived it usefulness (or rather the toolset can now more easily provide the functionality).

he himself is not using it anymore. instead, he uses the following procedure:

  1. download and install SimpleTest
  2. put a require_once('autorun.php'); at the top of the test file

    note: this requires the SimpleTest directory containing autorun.php to be in your include_path. alternatively, you can include autorun.php by full path, like require_once('C:/full/path/to/your/Simpletest/autorun.php');. it might even be possible not having to change the test file by including autorun.php via auto_prepend_file.

  3. run the test by right clicking on the test file and select "Run As PHP Script"
  4. the output from the testing shows up in the eclipse console

again according to the author,

this is easier to configure and it runs faster than the plugin. The other benefit of running this way is that if you want to debug your test, when you right click the test file you can click "Debug As PHP Script" instead of "Run As".

深白境迁sunset 2024-08-12 06:37:24

您需要下载应用程序代码。

看看
http://www.thetricky.net/php/php-unit-testing -在日食中

You need to download the application code.

Take a look at
http://www.thetricky.net/php/php-unit-testing-in-eclipse

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文