Improve UX for invoice template management (#4121)
change translations and to explain that calculator actually group items by fields
This commit is contained in:
@@ -16,6 +16,7 @@ use App\Entity\Project;
|
||||
use App\Entity\Timesheet;
|
||||
use App\Entity\User;
|
||||
use App\Invoice\CalculatorInterface;
|
||||
use App\Invoice\InvoiceModel;
|
||||
use App\Repository\Query\InvoiceQuery;
|
||||
use App\Tests\Invoice\DebugFormatter;
|
||||
use App\Tests\Mocks\InvoiceModelFactoryFactory;
|
||||
@@ -23,7 +24,18 @@ use PHPUnit\Framework\TestCase;
|
||||
|
||||
abstract class AbstractCalculatorTest extends TestCase
|
||||
{
|
||||
protected function assertEmptyModel(CalculatorInterface $sut)
|
||||
abstract protected function getCalculator(): CalculatorInterface;
|
||||
|
||||
public function testCalculatorInterface(): void
|
||||
{
|
||||
$sut = $this->getCalculator();
|
||||
|
||||
self::assertLessThanOrEqual(20, \strlen($sut->getId()));
|
||||
|
||||
$this->assertEmptyModel($sut);
|
||||
}
|
||||
|
||||
private function assertEmptyModel(CalculatorInterface $sut): void
|
||||
{
|
||||
$model = $this->getEmptyModel();
|
||||
$this->assertEquals('EUR', $model->getCurrency());
|
||||
@@ -38,7 +50,7 @@ abstract class AbstractCalculatorTest extends TestCase
|
||||
$this->assertEquals(0, $sut->getTax());
|
||||
}
|
||||
|
||||
protected function getEmptyModel()
|
||||
private function getEmptyModel(): InvoiceModel
|
||||
{
|
||||
$customer = new Customer('foo');
|
||||
$template = new InvoiceTemplate();
|
||||
@@ -52,7 +64,7 @@ abstract class AbstractCalculatorTest extends TestCase
|
||||
return $model;
|
||||
}
|
||||
|
||||
protected function assertDescription(CalculatorInterface $sut, $addProject = false, $addActivity = false)
|
||||
protected function assertDescription(CalculatorInterface $sut, $addProject = false, $addActivity = false): void
|
||||
{
|
||||
$customer = new Customer('foo');
|
||||
$template = new InvoiceTemplate();
|
||||
|
||||
Reference in New Issue
Block a user