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