protected function getTransactionManager() { $transactionManager = $this->getMock('Sonata\\Component\\Payment\\TransactionManagerInterface'); $transactionManager->expects($this->once())->method('create')->will($this->returnValue(new DebugPaymentTest_Transaction())); return $transactionManager; }