added command to create invoices via bash (#1574)
This commit is contained in:
@@ -9,12 +9,15 @@
|
||||
|
||||
namespace App\Tests\Invoice;
|
||||
|
||||
use App\Entity\Invoice;
|
||||
use App\Entity\InvoiceDocument;
|
||||
use App\Invoice\Calculator\DefaultCalculator;
|
||||
use App\Invoice\NumberGenerator\DateNumberGenerator;
|
||||
use App\Invoice\Renderer\TwigRenderer;
|
||||
use App\Invoice\ServiceInvoice;
|
||||
use App\Repository\InvoiceDocumentRepository;
|
||||
use App\Repository\InvoiceRepository;
|
||||
use App\Tests\Mocks\Security\UserDateTimeFactoryFactory;
|
||||
use App\Utils\FileHelper;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Twig\Environment;
|
||||
@@ -27,8 +30,18 @@ class ServiceInvoiceTest extends TestCase
|
||||
private function getSut(array $paths): ServiceInvoice
|
||||
{
|
||||
$repo = new InvoiceDocumentRepository($paths);
|
||||
$invoiceRepo = $this->createMock(InvoiceRepository::class);
|
||||
$userDateTime = (new UserDateTimeFactoryFactory($this))->create();
|
||||
|
||||
return new ServiceInvoice($repo, new FileHelper(realpath(__DIR__ . '/../../var/data/')));
|
||||
return new ServiceInvoice($repo, new FileHelper(realpath(__DIR__ . '/../../var/data/')), $invoiceRepo, $userDateTime, new DebugFormatter());
|
||||
}
|
||||
|
||||
public function testInvalidExceptionOnChangeState()
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Unknown invoice status');
|
||||
$sut = $this->getSut([]);
|
||||
$sut->changeInvoiceStatus(new Invoice(), 'foo');
|
||||
}
|
||||
|
||||
public function testEmptyObject()
|
||||
|
||||
Reference in New Issue
Block a user