public function testGetInvoice()
 {
     $invoice = $this->getMock('Luupab\\InvoiceBundle\\Model\\InvoiceInterface');
     $event = new InvoiceEvent($invoice);
     $this->assertEquals($invoice, $event->getInvoice());
 }
 /**
  * Creates and persists a invoice with the specified id.
  *
  * @param Omnisoft\InvoiceBundle\Event\InvoiceEvent $event
  */
 public function onCreate(InvoiceEvent $event)
 {
     $invoice = $event->getInvoice();
     $invoice->setReference(sprintf("%07d", $invoice->getId()));
 }