Hi Dave,
I found the fix to your problem. I added the following lines below in my bootstrap.
define( 'DOING_AJAX', true );
global $wpdb;
global $wp_embed;
$GLOBALS[ '_wp_deprecated_widgets_callbacks' ] = array();
require_once( 'wp-load.php' );
Also amended wp-settings.php and replaced
$wp_widget_factory =& new WP_Widget_Factory();
with
$GLOBALS[ 'wp_widget_factory' ] =& new WP_Widget_Factory();
Also you’ll need to add the code below in your PHPUnit_Framework_TestCase or PHPUnit_Framework_TestSuite child class
protected $backupGlobals = FALSE;
protected $backupStaticAttributes = FALSE;
Hope that helps!
David Ogilo