Bootstrapping Craft for PHPUnit on command line I'm trying to run some commands on a Jenkins server to have PHPUnit execute the tests and report the results. 

When I do require_once 'craft/app/bootstrap.php'; It is giving an error saying: PHP Notice:  Undefined index: SERVER_NAME in craft/app/bootstrap.php on line 105

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). It was suggested that I use craft/etc/console/yiic.php as my bootstrap file for PHPUnit. However, this is throwing errors about CDbConnection and is unable to connect.

Is there any way to bootstrap Craft from a command line to run PHPUnit? I'm unable to get it working without an apache server.
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.