Upgrade tests to PhpUnit 10 (#5252)
This commit is contained in:
@@ -34,12 +34,12 @@ class PdfRendererTest extends KernelTestCase
|
||||
{
|
||||
$env = new Environment(new ArrayLoader([]));
|
||||
$sut = new PdfRenderer($env, $this->createMock(HtmlToPdfConverter::class));
|
||||
$this->assertTrue($sut->supports($this->getInvoiceDocument('default.pdf.twig', true)));
|
||||
$this->assertTrue($sut->supports($this->getInvoiceDocument('service-date.pdf.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('timesheet.html.twig')));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('company.docx', true)));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('spreadsheet.xlsx', true)));
|
||||
$this->assertFalse($sut->supports($this->getInvoiceDocument('open-spreadsheet.ods', true)));
|
||||
self::assertTrue($sut->supports($this->getInvoiceDocument('default.pdf.twig', true)));
|
||||
self::assertTrue($sut->supports($this->getInvoiceDocument('service-date.pdf.twig')));
|
||||
self::assertFalse($sut->supports($this->getInvoiceDocument('timesheet.html.twig')));
|
||||
self::assertFalse($sut->supports($this->getInvoiceDocument('company.docx', true)));
|
||||
self::assertFalse($sut->supports($this->getInvoiceDocument('spreadsheet.xlsx', true)));
|
||||
self::assertFalse($sut->supports($this->getInvoiceDocument('open-spreadsheet.ods', true)));
|
||||
}
|
||||
|
||||
public function testRenderAttachment(): void
|
||||
@@ -64,9 +64,9 @@ class PdfRendererTest extends KernelTestCase
|
||||
$document = $this->getInvoiceDocument('default.pdf.twig', true);
|
||||
|
||||
$response = $sut->render($document, $model);
|
||||
$this->assertEquals('application/pdf', $response->headers->get('Content-Type'));
|
||||
$this->assertStringContainsString('attachment; filename', $response->headers->get('Content-Disposition'));
|
||||
$this->assertNotEmpty($response->getContent());
|
||||
self::assertEquals('application/pdf', $response->headers->get('Content-Type'));
|
||||
self::assertStringContainsString('attachment; filename', $response->headers->get('Content-Disposition'));
|
||||
self::assertNotEmpty($response->getContent());
|
||||
}
|
||||
|
||||
public function testRenderInline(): void
|
||||
@@ -93,8 +93,8 @@ class PdfRendererTest extends KernelTestCase
|
||||
|
||||
$sut->setDispositionInline(true);
|
||||
$response = $sut->render($document, $model);
|
||||
$this->assertStringContainsString('inline; filename', $response->headers->get('Content-Disposition'));
|
||||
$this->assertNotEmpty($response->getContent());
|
||||
self::assertStringContainsString('inline; filename', $response->headers->get('Content-Disposition'));
|
||||
self::assertNotEmpty($response->getContent());
|
||||
}
|
||||
|
||||
public function testRenderAll(): void
|
||||
@@ -142,9 +142,9 @@ class PdfRendererTest extends KernelTestCase
|
||||
$document = new InvoiceDocument(new \SplFileInfo($filename));
|
||||
|
||||
$response = $sut->render($document, $model);
|
||||
$this->assertEquals('application/pdf', $response->headers->get('Content-Type'));
|
||||
$this->assertStringContainsString('attachment; filename', $response->headers->get('Content-Disposition'));
|
||||
$this->assertNotEmpty($response->getContent());
|
||||
self::assertEquals('application/pdf', $response->headers->get('Content-Type'));
|
||||
self::assertStringContainsString('attachment; filename', $response->headers->get('Content-Disposition'));
|
||||
self::assertNotEmpty($response->getContent());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user