Bootstrapping Craft for PHPUnit on command line
I read that you cannot use bootstrap.php in the craft/app folder because you're essentially trying to bootstrap a webapp (and this server isn't a webserver).


Not sure where you read that, but that doesn't sound right.

I'm assuming you've got a multi-environment config setup?  If so, then manually set the CRAFT_ENVIRONMENT PHP constant before you load the Craft bootstrap.php file to the environment you want Craft to load in the config files.

That will get rid of the Undefined index: SERVER_NAME error you're getting as well as should fixed your database connection issue.