views:

559

answers:

1

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%5Feclipse.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!

+2  A: 

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".

ax