new invoice template variables for budgets (#3005)

This commit is contained in:
Kevin Papst
2021-12-08 22:15:07 +01:00
committed by GitHub
parent 82525f382d
commit 22ce6b047a
31 changed files with 389 additions and 188 deletions

View File

@@ -16,6 +16,7 @@ use App\Invoice\Calculator\DefaultCalculator;
use App\Invoice\InvoiceModel;
use App\Repository\Query\InvoiceQuery;
use App\Tests\Invoice\NumberGenerator\IncrementingNumberGenerator;
use App\Tests\Mocks\InvoiceModelFactoryFactory;
use PHPUnit\Framework\TestCase;
/**
@@ -26,7 +27,7 @@ class InvoiceModelTest extends TestCase
public function testEmptyObject()
{
$formatter = new DebugFormatter();
$sut = new InvoiceModel($formatter);
$sut = (new InvoiceModelFactoryFactory($this))->create()->createModel($formatter);
self::assertNull($sut->getQuery());
self::assertNull($sut->getCustomer());
@@ -51,7 +52,7 @@ class InvoiceModelTest extends TestCase
public function testEmptyObjectThrowsExceptionOnNumberGenerator()
{
$formatter = new DebugFormatter();
$sut = new InvoiceModel($formatter);
$sut = (new InvoiceModelFactoryFactory($this))->create()->createModel($formatter);
$this->expectException(\Exception::class);
$this->expectExceptionMessage('InvoiceModel::getInvoiceNumber() cannot be called before calling setNumberGenerator()');
@@ -60,7 +61,7 @@ class InvoiceModelTest extends TestCase
public function testSetter()
{
$sut = new InvoiceModel(new DebugFormatter());
$sut = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$query = new InvoiceQuery();
self::assertInstanceOf(InvoiceModel::class, $sut->setQuery($query));
@@ -95,7 +96,7 @@ class InvoiceModelTest extends TestCase
*/
public function testDeprecations()
{
$sut = new InvoiceModel(new DebugFormatter());
$sut = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter());
$entries = [new Timesheet()];
self::assertInstanceOf(InvoiceModel::class, $sut->setEntries($entries));