The tutorial site I posted seems to do the testing like this:

Code:
find new object position (position + velocity).
if edge inside a wall
  move object so it touches edge of wall 
else 
  do full movement in that direction
Oh, and it breaks up the movement and does it vertically then horizontally (or is it the other way around...I forget LOL)

I hope this helps

cheers,
Paul