Instead of "phpunit".
That line should be $d = $c->$db;

If my test database is called something other then "phpunit" then it wont work in authenticated enviornment