The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

It's so I can generate API documentation once im totaly done with the project.. and since I work in a team of 3 or 4, I need to make documents available to them.

It's much easier to look at API documentation than have to look at 400 different functions or classes or whatever

DougBTX's point is that you should include into the inline documentation only what you really need, i.e. everything that isn't already obvious. If your method is called addDocument() and is, say, passed a parameter $documentPath, there is very few additional information you may add to inline documentation -- any parsing tool will extract the method and param names, and your comment may be as simple as

It just isn't as much fun writing tests for code you know works. How about writing tests for new code you write? Or, the next time you find an unexpected bug, try and test it to pieces rather than using echos or log files etc. That might be a better start than just saying "I've got some code that works, I'll write some tests to make sure it works", it is always more fun to know what it is you are trying to achieve when you do something

At the risk of seeming egotistical, here is the comment I just posted to the SimpleTest mailing list:

As far as I'm concerned I gave up on PHPUnit because of a lack of documentation and lack of compatibility between versions. I used the pre-1.0 versions of PHPUnit and did fine with them. But I was unable to get version 1 to work. When Advanced PHP Programming appeared I tried copying the examples from the book, but it still didn't work. I simply couldn't figure out how to run the tests.

What I generally do when I can't get open source software to work is to try an alternative. My experience is that trying to fix problems with poorly documented software is frequently more time-consuming than learning something else.

I now use SimpleTest exclusively and don't know any good reasons why I would switch back.

Of course that's a very simple example. If a Greeter class should respond differently to different users, you'd write a test for each case and check that the class produces the correct greeting for each user type. Every aspect of the class's desired behaviour should be explored in fine detail. With detailed tests, when something goes wrong the tests will tell you exactly where the problem is, thus making it very easy to fix.

Assertions act as constraints on possible implementations of the class. Assert everything you have to, but no more than you have to since that can impede future refactorings.

Marcus, curious if there is anything that you haven't implemented in SimpleTest that you wanted to? Or is the project pretty much complete?

I am actually catching up on all of these things now. Mainly it's missing file uploading, which is a terribly accident prone area. The other one is running group tests in a separate process which will come in the release after the upcoming one.

As for what I want to add two years after starting the project, mainly stronger HTML parsing so that I can do something like this if needed...

SimpleTest

Hi to all

I've installed your plugin SimpleTest for eclipse. I can see the "Result view" on my screen. But how should make it working ? Is it possible to have an exmple on how to use it ?
Btw, i'm quite new with Eclipse and phpEclipse.

there are some readme files in the plugins/...simpletest../ directory (don't know the exact name).

I've been meaning to post the following for a while, but I kept forgetting:

I gave the plugin a run and was able to run a test through it. The plugin is not very useful yet because it does not support group tests yet.

I believe the plugin itself can be tested pretty well automatically by making some PHP files that are known to produce failing tests and then test to see that the plugin detects the test failure and displays the error correctly. I'll see if I feel like writing some JUnit tests

I believe the plugin itself can be tested pretty well automatically by making some PHP files that are known to produce failing tests and then test to see that the plugin detects the test failure and displays the error correctly. I'll see if I feel like writing some JUnit tests

Please send a mail to Steve as I know he is very keen to receive feedback right now.

All i have to do is the following: Click right on all_tests.php, choose run, choose PHP Application and fill in the path of the file. Then in the Arguments tab i enter the path of the file (instead of the default working directory). If i hit [Run] i get something like below in my console.. (Ok, most people like the green bar more..)

I just installed the simpletest plug-in but it doesn't seem to work. Eclipse says that it isn't installed.

What version of eclipse are you using? i tried it with 3.1 SDK, 3.1, 3.0.1.
With 3.1 SDK i got it working, but then i installed TruStudio (never used PHPEclipse too) and TruStudio wouldn't work. The other way round it was the same.

But perhaps it's only me being stupid

I'd really like to run tests with 1-2 mouseclicks, but having the choice between being able to use TruStudio XOR Simpletest Plugin i'd go for Trustudio