@@ -16,63 +16,55 @@ use Tester\Assert;
1616require __DIR__ . '/../bootstrap.php ' ;
1717$ origData = file_get_contents (__DIR__ . '/templates/example1.htm ' );
1818
19- test (
20- function () use ($ origData ): void {
21- $ fileResponse = new PdfResponse ($ origData );
22- $ fileResponse ->setSaveMode (PdfResponse::INLINE );
23- $ fileResponse ->pageOrientation = PdfResponse::ORIENTATION_LANDSCAPE ;
24- $ fileResponse ->pageFormat = 'A4-L ' ;
25- $ fileResponse ->pageMargins = $ fileResponse ->getPageMargins ();
19+ test (function () use ($ origData ): void {
20+ $ fileResponse = new PdfResponse ($ origData );
21+ $ fileResponse ->setSaveMode (PdfResponse::INLINE );
22+ $ fileResponse ->pageOrientation = PdfResponse::ORIENTATION_LANDSCAPE ;
23+ $ fileResponse ->pageFormat = 'A4-L ' ;
24+ $ fileResponse ->pageMargins = $ fileResponse ->getPageMargins ();
2625
27- ob_start ();
28- $ fileResponse ->send (new Request (new UrlScript ()), new Response ());
29- $ actualData = ob_get_clean ();
26+ ob_start ();
27+ $ fileResponse ->send (new Request (new UrlScript ()), new Response ());
28+ $ actualData = ob_get_clean ();
3029
31- Assert::match ('#^%PDF-#i ' , $ actualData );
32- }
33- );
30+ Assert::match ('#^%PDF-#i ' , $ actualData );
31+ });
3432
35- test (
36- function () use ($ origData ): void {
37- $ fileResponse = new PdfResponse ($ origData );
38- $ fileResponse ->getMPDF ();
33+ test (function () use ($ origData ): void {
34+ $ fileResponse = new PdfResponse ($ origData );
35+ $ fileResponse ->getMPDF ();
3936
40- Assert::exception (
41- function () use ($ fileResponse ): void {
42- $ fileResponse ->pageOrientation = PdfResponse::ORIENTATION_LANDSCAPE ;
43- },
44- InvalidStateException::class,
45- 'mPDF instance already created. Set page orientation before calling getMPDF '
46- );
47- }
48- );
37+ Assert::exception (
38+ function () use ($ fileResponse ): void {
39+ $ fileResponse ->pageOrientation = PdfResponse::ORIENTATION_LANDSCAPE ;
40+ },
41+ InvalidStateException::class,
42+ 'mPDF instance already created. Set page orientation before calling getMPDF '
43+ );
44+ });
4945
50- test (
51- function () use ($ origData ): void {
52- $ fileResponse = new PdfResponse ($ origData );
53- $ fileResponse ->getMPDF ();
46+ test (function () use ($ origData ): void {
47+ $ fileResponse = new PdfResponse ($ origData );
48+ $ fileResponse ->getMPDF ();
5449
55- Assert::exception (
56- function () use ($ fileResponse ): void {
57- $ fileResponse ->pageFormat = 'A4-L ' ;
58- },
59- InvalidStateException::class,
60- 'mPDF instance already created. Set page format before calling getMPDF '
61- );
62- }
63- );
50+ Assert::exception (
51+ function () use ($ fileResponse ): void {
52+ $ fileResponse ->pageFormat = 'A4-L ' ;
53+ },
54+ InvalidStateException::class,
55+ 'mPDF instance already created. Set page format before calling getMPDF '
56+ );
57+ });
6458
65- test (
66- function () use ($ origData ): void {
67- $ fileResponse = new PdfResponse ($ origData );
68- $ fileResponse ->getMPDF ();
59+ test (function () use ($ origData ): void {
60+ $ fileResponse = new PdfResponse ($ origData );
61+ $ fileResponse ->getMPDF ();
6962
70- Assert::exception (
71- function () use ($ fileResponse ): void {
72- $ fileResponse ->pageMargins = $ fileResponse ->getPageMargins ();
73- },
74- InvalidStateException::class,
75- 'mPDF instance already created. Set page margins before calling getMPDF '
76- );
77- }
78- );
63+ Assert::exception (
64+ function () use ($ fileResponse ): void {
65+ $ fileResponse ->pageMargins = $ fileResponse ->getPageMargins ();
66+ },
67+ InvalidStateException::class,
68+ 'mPDF instance already created. Set page margins before calling getMPDF '
69+ );
70+ });
0 commit comments