Using Eclipse SimpleTest Plugin - SimpleTest Doesn't Work

I am using Eclipse 3.4.2 and installed the latest plugin for easy testing with help> Software Updates ...

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

I believe this configuration was correct and performed the first test found on the simpletest eclipse website: 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 follow all the instructions, but when I right-click and select RUN AS> SimpleTest, nothing happens.

I need help with this.

Thanks!

+4
source share
2 answers

according to the author of the simplest plugin,

the plugin has outlived its usefulness (or, rather, a set of tools can now easily provide functionality).

he himself no longer uses it. instead, it uses the following procedure :

  • download and install SimpleTest
  • put a require_once('autorun.php'); to the beginning of the test file

    note: this requires the SimpleTest directory containing autorun.php to be in include_path . alternatively, you can enable autorun.php in the full path, for example require_once('C:/full/path/to/your/Simpletest/autorun.php'); . it may not even be possible to modify the test file by including autorun.php through auto_prepend_file .

  • run the test by right-clicking on the test file and select "Run as PHP Script"
  • test output is displayed in the eclipse console

again according to the author,

it's easier to set up and it works faster than the plugin. Another advantage of this method is that if you want to debug your test by right-clicking on the test file, you can click "Debug as PHP Script" instead of "Run As".

+5
source

You need to download the application code.

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

+1
source

All Articles