fix php 8.1 deprecations (#3648)
* show session maxlifetime in doctor * rephrase compatibility in release notes * bump version
This commit is contained in:
@@ -28,4 +28,27 @@ class InvoiceDocumentTest extends TestCase
|
||||
self::assertEquals('default.html.twig', $sut->getName());
|
||||
self::assertIsInt($sut->getLastChange());
|
||||
}
|
||||
|
||||
public function testThrowsOnDeletedFile()
|
||||
{
|
||||
$catchedException = false;
|
||||
|
||||
$dir = realpath(__DIR__ . '/../../templates/invoice/renderer');
|
||||
$file = tempnam($dir, 'invoice-renderer');
|
||||
|
||||
if ($file !== false) {
|
||||
touch($file);
|
||||
$sut = new InvoiceDocument(new \SplFileInfo($file));
|
||||
unlink($file);
|
||||
|
||||
try {
|
||||
// names are cached by SplFileInfo, so we need to trigger a function that does access the file
|
||||
$sut->getLastChange();
|
||||
} catch (\Exception $exception) {
|
||||
$catchedException = true;
|
||||
}
|
||||
}
|
||||
|
||||
self::assertTrue($catchedException, 'Invoice document did not throw exception');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,13 +27,11 @@ class DocxRendererTest extends TestCase
|
||||
$sut = $this->getAbstractRenderer(DocxRenderer::class);
|
||||
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('default.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('freelancer.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('freelancer.pdf.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('timesheet.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('foo.html.twig')));
|
||||
$this->assertTrue($sut->supports($this->getInvoiceDocument('company.docx')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('export.csv')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('spreadsheet.xlsx')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('open-spreadsheet.ods')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('spreadsheet.xlsx', true)));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('open-spreadsheet.ods', true)));
|
||||
}
|
||||
|
||||
public function testRender()
|
||||
|
||||
@@ -31,13 +31,10 @@ class JsonRendererTest extends KernelTestCase
|
||||
$sut = new JsonRenderer($env);
|
||||
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('default.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('freelancer.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('timesheet.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('foo.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('company.docx')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('export.csv')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('spreadsheet.xlsx')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('open-spreadsheet.ods')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('spreadsheet.xlsx', true)));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('open-spreadsheet.ods', true)));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('text.txt.twig')));
|
||||
$this->assertTrue($sut->supports($this->getInvoiceDocument('javascript.json.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('xml.xml.twig')));
|
||||
|
||||
@@ -29,12 +29,10 @@ class OdsRendererTest extends TestCase
|
||||
$sut = $this->getAbstractRenderer(OdsRenderer::class);
|
||||
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('default.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('freelancer.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('freelancer.pdf.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('timesheet.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('foo.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('company.docx')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('export.csv')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('spreadsheet.xlsx')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('spreadsheet.xlsx', true)));
|
||||
$this->assertTrue($sut->supports($this->getInvoiceDocument('open-spreadsheet.ods', true)));
|
||||
}
|
||||
|
||||
|
||||
@@ -48,11 +48,9 @@ class PdfRendererTest extends KernelTestCase
|
||||
$this->assertTrue($sut->supports($this->getInvoiceDocument('default.pdf.twig', true)));
|
||||
$this->assertTrue($sut->supports($this->getInvoiceDocument('freelancer.pdf.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('timesheet.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('foo.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('company.docx')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('export.csv')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('spreadsheet.xlsx')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('open-spreadsheet.ods')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('spreadsheet.xlsx', true)));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('open-spreadsheet.ods', true)));
|
||||
}
|
||||
|
||||
public function testRender()
|
||||
|
||||
@@ -31,13 +31,11 @@ class TextRendererTest extends KernelTestCase
|
||||
$sut = new TextRenderer($env);
|
||||
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('default.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('freelancer.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('freelancer.pdf.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('timesheet.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('foo.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('company.docx')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('export.csv')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('spreadsheet.xlsx')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('open-spreadsheet.ods')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('spreadsheet.xlsx', true)));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('open-spreadsheet.ods', true)));
|
||||
$this->assertTrue($sut->supports($this->getInvoiceDocument('text.txt.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('javascript.json.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('xml.xml.twig')));
|
||||
|
||||
@@ -33,11 +33,9 @@ class TwigRendererTest extends KernelTestCase
|
||||
$this->assertTrue($sut->supports($this->getInvoiceDocument('default.html.twig')));
|
||||
$this->assertTrue($sut->supports($this->getInvoiceDocument('timesheet.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('freelancer.pdf.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('foo.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('company.docx')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('export.csv')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('spreadsheet.xlsx')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('open-spreadsheet.ods')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('spreadsheet.xlsx', true)));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('open-spreadsheet.ods', true)));
|
||||
}
|
||||
|
||||
public function testRender()
|
||||
|
||||
@@ -30,13 +30,11 @@ class XlsxRendererTest extends TestCase
|
||||
$sut = $this->getAbstractRenderer(XlsxRenderer::class);
|
||||
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('default.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('freelancer.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('freelancer.pdf.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('timesheet.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('foo.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('company.docx')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('export.csv')));
|
||||
$this->assertTrue($sut->supports($this->getInvoiceDocument('spreadsheet.xlsx', true)));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('open-spreadsheet.ods')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('open-spreadsheet.ods', true)));
|
||||
}
|
||||
|
||||
public function getTestModel()
|
||||
|
||||
@@ -31,14 +31,12 @@ class XmlRendererTest extends KernelTestCase
|
||||
$sut = new XmlRenderer($env);
|
||||
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('default.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('freelancer.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('freelancer.pdf.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('timesheet.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('javascript.json.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('foo.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('company.docx')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('export.csv')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('spreadsheet.xlsx')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('open-spreadsheet.ods')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('spreadsheet.xlsx', true)));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('open-spreadsheet.ods', true)));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('text.txt.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('javascript.json.twig')));
|
||||
$this->assertTrue($sut->supports($this->getInvoiceDocument('xml.xml.twig')));
|
||||
|
||||
@@ -69,7 +69,10 @@ class DurationValidatorTest extends ConstraintValidatorTestCase
|
||||
{
|
||||
$constraint = new Duration();
|
||||
$this->validator->validate($input, $constraint);
|
||||
$this->validator->validate(strtoupper($input), $constraint);
|
||||
if ($input !== null) {
|
||||
$input = strtoupper($input);
|
||||
}
|
||||
$this->validator->validate($input, $constraint);
|
||||
$this->assertNoViolation();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user