I've had surprising success using Drupal as a web app framework. It's highly extensible - pretty much every default behaviour can be overridden easily via modules, and it's a pretty blank slate to start with as well.
Drupal 7 has unit testing built-in, and earlier versions can do it easily via a plugin.