added invoice model to invoice created event (#3079)
* added model to InvoiceCreatedEvent * allow to switch formatter locale
This commit is contained in:
@@ -11,6 +11,8 @@ namespace App\Tests\Event;
|
||||
|
||||
use App\Entity\Invoice;
|
||||
use App\Event\InvoiceCreatedEvent;
|
||||
use App\Tests\Invoice\DebugFormatter;
|
||||
use App\Tests\Mocks\InvoiceModelFactoryFactory;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
@@ -21,9 +23,11 @@ class InvoiceCreatedEventTest extends TestCase
|
||||
public function testDefaultValues()
|
||||
{
|
||||
$invoice = new Invoice();
|
||||
$model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
|
||||
|
||||
$sut = new InvoiceCreatedEvent($invoice);
|
||||
$sut = new InvoiceCreatedEvent($invoice, $model);
|
||||
|
||||
self::assertSame($invoice, $sut->getInvoice());
|
||||
self::assertSame($model, $sut->getInvoiceModel());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user