added command to create invoices via bash (#1574)

This commit is contained in:
Kevin Papst
2020-03-20 13:14:05 +01:00
committed by GitHub
parent 7b13ea860a
commit b8c5323ece
35 changed files with 1301 additions and 273 deletions

View File

@@ -58,7 +58,7 @@ class CsvRendererTest extends TestCase
$file = $response->getFile();
$this->assertEquals('text/csv', $response->headers->get('Content-Type'));
$filename = $model->getNumberGenerator()->getInvoiceNumber() . '-customer_with_special_name.csv';
$filename = $model->getInvoiceNumber() . '-customer_with_special_name.csv';
$this->assertEquals('attachment; filename=' . $filename, $response->headers->get('Content-Disposition'));
$this->assertTrue(file_exists($file->getRealPath()));

View File

@@ -119,6 +119,10 @@ class DebugRendererTest extends TestCase
'customer.number',
'customer.homepage',
'customer.comment',
'customer.email',
'customer.fax',
'customer.phone',
'customer.mobile',
'customer.meta.foo-customer',
'activity.id',
'activity.name',

View File

@@ -45,7 +45,7 @@ class DocxRendererTest extends TestCase
/** @var BinaryFileResponse $response */
$response = $sut->render($document, $model);
$filename = $model->getNumberGenerator()->getInvoiceNumber() . '-customer_with_special_name.docx';
$filename = $model->getInvoiceNumber() . '-customer_with_special_name.docx';
$file = $response->getFile();
$this->assertEquals('application/vnd.openxmlformats-officedocument.wordprocessingml.document', $response->headers->get('Content-Type'));
$this->assertEquals('attachment; filename=' . $filename, $response->headers->get('Content-Disposition'));

View File

@@ -56,7 +56,7 @@ class OdsRendererTest extends TestCase
/** @var BinaryFileResponse $response */
$response = $sut->render($document, $model);
$filename = $model->getNumberGenerator()->getInvoiceNumber() . '-customer_with_special_name.ods';
$filename = $model->getInvoiceNumber() . '-customer_with_special_name.ods';
$file = $response->getFile();
$this->assertEquals('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', $response->headers->get('Content-Type'));
$this->assertEquals('attachment; filename=' . $filename, $response->headers->get('Content-Disposition'));

View File

@@ -62,7 +62,7 @@ class TwigRendererTest extends KernelTestCase
$content = $response->getContent();
$filename = $model->getNumberGenerator()->getInvoiceNumber() . '-customer_with_special_name';
$filename = $model->getInvoiceNumber() . '-customer_with_special_name';
$this->assertStringContainsString('<title>' . $filename . '</title>', $content);
$this->assertStringContainsString('<h2 class="page-header">
<span contenteditable="true">a very *long* test invoice / template title with [special] character</span>

View File

@@ -57,7 +57,7 @@ class XlsxRendererTest extends TestCase
/** @var BinaryFileResponse $response */
$response = $sut->render($document, $model);
$filename = $model->getNumberGenerator()->getInvoiceNumber() . '-customer_with_special_name.xlsx';
$filename = $model->getInvoiceNumber() . '-customer_with_special_name.xlsx';
$file = $response->getFile();
$this->assertEquals('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', $response->headers->get('Content-Type'));
$this->assertEquals('attachment; filename=' . $filename, $response->headers->get('Content-Disposition'));