Jump to content

gannina

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

gannina's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I guess the user doesn't want to see those error messages?
  2. Hi, I am trying to learn how to do unit testing with Simpletest, but there are a few things I don't get. 1. Do you always make your methods return (true, false, or a value)? - if a method doesn't return anything is there another way to test whats going on in a method or is it standard practice to just make you methods return something? 2. I was reading through a book and it had the following example [code] If (strlen ($pass) < 5 ) { throw new Exception("Password must have 5 or more letters"); } If (is_null ($name) { return false; } [/code] Why does the first one throw an error message, and not some assert statement, or both? The second statement returns false, so it can be tested in a test case. Why not just display an error message instead? Like: [code] echo 'Name is empty'; [/code] I'm kinda confused on those issues. Also, can anyone recommend a simple introduction to unit testing. The documentation for simpletest doesn't cover the basics in unit testing. Thanks in advance
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.