protected function getBasketManager($qbCallback)
{
if (version_compare(\PHPUnit_Runner_Version::id(), '5.0.0', '>=')) {
$this->markTestSkipped('Not compatible with PHPUnit 5.');
}
$em = EntityManagerMockFactory::create($this, $qbCallback, array('id', 'locale'));
$registry = $this->getMock('Doctrine\\Common\\Persistence\\ManagerRegistry');
$registry->expects($this->any())->method('getManagerForClass')->will($this->returnValue($em));
return new BasketManager('Sonata\\BasketBundle\\Entity\\BaseBasket', $registry);
}