exit interrupts my unit test

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am trying to be a good boy and write a test for every method I'm
writing. However, exit() is of course interrupting my test as I want
all of my tests to be on one page.  I can't just place it last as I
have more then a few exit()s.

Please don't recommend using some great open source unit testing
framework as I really want to write my own.

Does anyone have any ideas? Is there a way to bypass exit or keep it
confined to a scope or something?

Re: exit interrupts my unit test

Duh, just used return rather then exit.

Re: exit interrupts my unit test

HappyCamper wrote:
Quoted text here. Click to load it

Nope.  exit() is doing exactly what it's supposed to do.

But why are you calling exit() so much?  I seldom call it - most often
after a header() redirect.  Otherwise I use conditionals to structure my

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Site Timeline