fix code when not run in a PHPUnit test mode