From bb89eb955eff73dc0219b7c2cb3b978e17e7f376 Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Mon, 25 Dec 2023 16:21:35 +0100 Subject: [PATCH] wip --- .github/workflows/run-tests.yml | 12 +- .gitignore | 3 + composer.json | 20 +- database/factories/ModelFactory.php | 19 -- database/migrations/create_pdf_table.php.stub | 19 -- package-lock.json | 40 ++++ package.json | 6 + resources/views/.gitkeep | 0 src/Enums/Orientation.php | 9 + src/Enums/PaperFormat.php | 18 ++ src/Facades/LaravelPdf.php | 16 -- src/Facades/Pdf.php | 24 +++ src/FakePdf.php | 15 ++ src/LaravelPdf.php | 7 - src/Pdf.php | 185 ++++++++++++++++++ ...iceProvider.php => PdfServiceProvider.php} | 9 +- src/Support/functions.php | 10 + tests/ExampleTest.php | 5 - tests/FakePdfTest.php | 11 ++ tests/PdfTest.php | 67 +++++++ tests/Pest.php | 39 +++- tests/TestCase.php | 17 +- tests/TestSupport/Views/test.blade.php | 3 + .../PdfTest__it_can_accept_margins__1.png | Bin 0 -> 3319 bytes .../PdfTest__it_can_accept_some_html__1.png | Bin 0 -> 2777 bytes ...Test__it_can_accept_the_orientation__1.png | Bin 0 -> 2214 bytes ...est__it_can_accept_the_paper_format__1.png | Bin 0 -> 5210 bytes ...can_create_a_pdf_using_the_function__1.png | Bin 0 -> 2663 bytes ...fTest__it_can_customize_browsershot__1.png | Bin 0 -> 2214 bytes 29 files changed, 456 insertions(+), 98 deletions(-) delete mode 100644 database/factories/ModelFactory.php delete mode 100644 database/migrations/create_pdf_table.php.stub create mode 100644 package-lock.json create mode 100644 package.json delete mode 100644 resources/views/.gitkeep create mode 100644 src/Enums/Orientation.php create mode 100644 src/Enums/PaperFormat.php delete mode 100644 src/Facades/LaravelPdf.php create mode 100644 src/Facades/Pdf.php create mode 100644 src/FakePdf.php delete mode 100755 src/LaravelPdf.php create mode 100755 src/Pdf.php rename src/{LaravelPdfServiceProvider.php => PdfServiceProvider.php} (56%) create mode 100644 src/Support/functions.php delete mode 100644 tests/ExampleTest.php create mode 100644 tests/FakePdfTest.php create mode 100644 tests/PdfTest.php create mode 100644 tests/TestSupport/Views/test.blade.php create mode 100644 tests/__snapshots__/PdfTest__it_can_accept_margins__1.png create mode 100644 tests/__snapshots__/PdfTest__it_can_accept_some_html__1.png create mode 100644 tests/__snapshots__/PdfTest__it_can_accept_the_orientation__1.png create mode 100644 tests/__snapshots__/PdfTest__it_can_accept_the_paper_format__1.png create mode 100644 tests/__snapshots__/PdfTest__it_can_create_a_pdf_using_the_function__1.png create mode 100644 tests/__snapshots__/PdfTest__it_can_customize_browsershot__1.png diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index f7492c5..8df1336 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -17,13 +17,12 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, windows-latest] - php: [8.3, 8.2, 8.1] + php: [8.3, 8.2] laravel: [10.*] stability: [prefer-lowest, prefer-stable] include: - laravel: 10.* testbench: 8.* - carbon: ^2.63 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} @@ -38,6 +37,11 @@ jobs: extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo coverage: none + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '20' + - name: Setup problem matchers run: | echo "::add-matcher::${{ runner.tool_cache }}/php.json" @@ -52,4 +56,6 @@ jobs: run: composer show -D - name: Execute tests - run: vendor/bin/pest --ci + run: + npm install + vendor/bin/pest --ci diff --git a/.gitignore b/.gitignore index a7f372d..c7f9965 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,9 @@ coverage docs phpunit.xml phpstan.neon +node_modules/ testbench.yaml vendor node_modules +tests/TestSupport/temp/ +public/storage diff --git a/composer.json b/composer.json index 1779f9c..6eb0cf9 100644 --- a/composer.json +++ b/composer.json @@ -17,13 +17,15 @@ ], "require": { "php": "^8.1", + "illuminate/contracts": "^10.0", + "spatie/browsershot": "v4.x-dev", "spatie/laravel-package-tools": "^1.14.0", - "illuminate/contracts": "^10.0" + "spatie/temporary-directory": "^2.2" }, "require-dev": { + "larastan/larastan": "^2.0.1", "laravel/pint": "^1.0", "nunomaduro/collision": "^7.8", - "larastan/larastan": "^2.0.1", "orchestra/testbench": "^8.8", "pestphp/pest": "^2.20", "pestphp/pest-plugin-arch": "^2.0", @@ -31,13 +33,19 @@ "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0", - "spatie/laravel-ray": "^1.26" + "spatie/laravel-ray": "^1.26", + "spatie/pdf-to-image": "^2.2", + "spatie/pest-plugin-snapshots": "^2.1", + "spatie/pixelmatch-php": "^1.0" }, "autoload": { "psr-4": { "Spatie\\LaravelPdf\\": "src/", "Spatie\\LaravelPdf\\Database\\Factories\\": "database/factories/" - } + }, + "files": [ + "src/Support/functions.php" + ] }, "autoload-dev": { "psr-4": { @@ -73,10 +81,10 @@ "extra": { "laravel": { "providers": [ - "Spatie\\LaravelPdf\\LaravelPdfServiceProvider" + "Spatie\\LaravelPdf\\PdfServiceProvider" ], "aliases": { - "LaravelPdf": "Spatie\\LaravelPdf\\Facades\\LaravelPdf" + "LaravelPdf": "Pdf" } } }, diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php deleted file mode 100644 index 856301f..0000000 --- a/database/factories/ModelFactory.php +++ /dev/null @@ -1,19 +0,0 @@ -id(); - - // add fields - - $table->timestamps(); - }); - } -}; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..938f0e8 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,40 @@ +{ + "name": "laravel-pdf", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "pixelmatch": "^5.3.0", + "pngjs": "^7.0.0" + } + }, + "node_modules/pixelmatch": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/pixelmatch/-/pixelmatch-5.3.0.tgz", + "integrity": "sha512-o8mkY4E/+LNUf6LzX96ht6k6CEDi65k9G2rjMtBe9Oo+VPKSvl+0GKHuH/AlG+GA5LPG/i5hrekkxUc3s2HU+Q==", + "dependencies": { + "pngjs": "^6.0.0" + }, + "bin": { + "pixelmatch": "bin/pixelmatch" + } + }, + "node_modules/pixelmatch/node_modules/pngjs": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-6.0.0.tgz", + "integrity": "sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg==", + "engines": { + "node": ">=12.13.0" + } + }, + "node_modules/pngjs": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-7.0.0.tgz", + "integrity": "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==", + "engines": { + "node": ">=14.19.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..0c8fd5d --- /dev/null +++ b/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "pixelmatch": "^5.3.0", + "pngjs": "^7.0.0" + } +} diff --git a/resources/views/.gitkeep b/resources/views/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/Enums/Orientation.php b/src/Enums/Orientation.php new file mode 100644 index 0000000..b94068b --- /dev/null +++ b/src/Enums/Orientation.php @@ -0,0 +1,9 @@ +viewName); + + return $this; + } +} diff --git a/src/LaravelPdf.php b/src/LaravelPdf.php deleted file mode 100755 index b566138..0000000 --- a/src/LaravelPdf.php +++ /dev/null @@ -1,7 +0,0 @@ -viewName = $view; + + $this->data = $data; + + return $this; + } + + public function orientation(string|Orientation $orientation): self + { + if ($orientation instanceof Orientation) { + $orientation = $orientation->value; + } + + $this->orientation = $orientation; + + return $this; + } + + public function inline(): self + { + $this->inline = true; + + return $this; + } + + public function html(string $html): self + { + $this->html = $html; + + return $this; + } + + public function download(string $downloadName): self + { + $this->name($downloadName); + + return $this; + } + + public function name(string $downloadName): self + { + $this->downloadName = $downloadName; + + return $this; + } + + public function base64(): string + { + return $this + ->getBrowsershot() + ->base64pdf(); + } + + public function margins( + float $top = 0, + float $right = 0, + float $bottom = 0, + float $left = 0, + string $unit = 'mm') + { + $this->margins = compact( + 'top', + 'right', + 'bottom', + 'left', + 'unit', + ); + + return $this; + } + + public function paperFormat(string|PaperFormat $paperFormat): self + { + if ($paperFormat instanceof PaperFormat) { + $paperFormat = $paperFormat->value; + } + + $this->paperFormat = $paperFormat; + + return $this; + } + + public function withBrowsershot(callable $callback): self + { + $this->customizeBrowsershot = $callback; + + return $this; + } + + public function save(string $path): self + { + $this + ->getBrowsershot() + ->save($path); + + return $this; + } + + protected function getHtml(): string + { + if ($this->html) { + return $this->html; + } + + return view($this->viewName, $this->data)->render(); + } + + protected function getBrowsershot(): Browsershot + { + $browsershot = Browsershot::html($this->getHtml()); + + if ($this->margins) { + $browsershot->margins(... $this->margins); + } + + if ($this->paperFormat) { + $browsershot->format($this->paperFormat); + } + + if ($this->orientation === Orientation::Landscape->value) { + $browsershot->landscape(); + } + + if ($this->customizeBrowsershot) { + ($this->customizeBrowsershot)($browsershot); + } + + return $browsershot; + } + + public function toResponse($request) + { + // TODO: Implement toResponse() method. + } +} + +/* + * return pdf('my.view', [ + 'title' => 'my title', +]); + +return pdf('my.view', [ + 'title' => 'my title', +])->inline(); + +return pdf('my.view', [ + 'title' => 'my title', +])->download($downloadName); + + +Pdf::view('my.view', $data + ->margins(10,20,30,40) + ->orientation(Orientation::Landscape) + ->paper(Paper::A3) // da's eigenlijk een A5 dan + ->save($path); + +Pdf::assertSee($text); +Pdf::assertViewIs($viewName); + */ diff --git a/src/LaravelPdfServiceProvider.php b/src/PdfServiceProvider.php similarity index 56% rename from src/LaravelPdfServiceProvider.php rename to src/PdfServiceProvider.php index 7f5254c..e5c6dfa 100644 --- a/src/LaravelPdfServiceProvider.php +++ b/src/PdfServiceProvider.php @@ -6,20 +6,13 @@ use Spatie\LaravelPackageTools\PackageServiceProvider; use Spatie\LaravelPdf\Commands\LaravelPdfCommand; -class LaravelPdfServiceProvider extends PackageServiceProvider +class PdfServiceProvider extends PackageServiceProvider { public function configurePackage(Package $package): void { - /* - * This class is a Package Service Provider - * - * More info: https://github.com/spatie/laravel-package-tools - */ $package ->name('laravel-pdf') ->hasConfigFile() - ->hasViews() - ->hasMigration('create_laravel-pdf_table') ->hasCommand(LaravelPdfCommand::class); } } diff --git a/src/Support/functions.php b/src/Support/functions.php new file mode 100644 index 0000000..8a2f561 --- /dev/null +++ b/src/Support/functions.php @@ -0,0 +1,10 @@ +view($viewPath, $data); +} diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php deleted file mode 100644 index 5d36321..0000000 --- a/tests/ExampleTest.php +++ /dev/null @@ -1,5 +0,0 @@ -toBeTrue(); -}); diff --git a/tests/FakePdfTest.php b/tests/FakePdfTest.php new file mode 100644 index 0000000..45df180 --- /dev/null +++ b/tests/FakePdfTest.php @@ -0,0 +1,11 @@ +targetPath = getTempPath('test.pdf'); +}); + +it('can create a pdf using the function', function () { + pdf('test')->save($this->targetPath); + + assertMatchesPdfSnapshot($this->targetPath); +}); + +it('can accept margins', function () { + Pdf::view('test')->margins(200)->save($this->targetPath); + + assertMatchesPdfSnapshot($this->targetPath); +}); + +it('can accept some html', function() { + Pdf::html('

Some custom HTML

')->save($this->targetPath); + + assertMatchesPdfSnapshot($this->targetPath); +}); + +it('can create a pdf using the facade', function() { + Pdf::view('test')->save($this->targetPath); + + assertMatchesPdfSnapshot($this->targetPath); +}); + +it('can return the base 64 encoded pdf', function() { + $base64string = Pdf::view('test')->base64(); + + expect($base64string)->toBeString(); +}); + +it('can accept the paper format', function() { + Pdf::view('test') + ->paperFormat(PaperFormat::A3) + ->save($this->targetPath); + + assertMatchesPdfSnapshot($this->targetPath); +}); + +it('can accept the orientation', function() { + Pdf::view('test') + ->orientation(Orientation::Landscape) + ->save($this->targetPath); + + assertMatchesPdfSnapshot($this->targetPath); +}); + +it('can customize browsershot', function() { + Pdf::view('test') + ->withBrowsershot(function(Browsershot $browsershot) { + $browsershot->landscape(); + }) + ->save($this->targetPath); + + assertMatchesPdfSnapshot($this->targetPath); +}); diff --git a/tests/Pest.php b/tests/Pest.php index bbd78f9..569f2d8 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -1,5 +1,42 @@ in(__DIR__); +uses(TestCase::class) + ->beforeAll(function () { + (new TemporaryDirectory(getTempPath()))->delete(); + }) + ->beforeEach(function () { + ray()->newScreen($this->name()); + + $this + ->tempDir = (new TemporaryDirectory(getTestSupportPath())) + ->name('temp') + ->force() + ->create(); + }) + ->in(__DIR__); + + +function getTestSupportPath($suffix = ''): string +{ + return __DIR__."/TestSupport/{$suffix}"; +} + +function getTempPath($suffix = ''): string +{ + return getTestSupportPath('temp/'.$suffix); +} + +function assertMatchesPdfSnapshot(string $pdfPath): void +{ + $imagePath = getTempPath('test' . '.png'); + + $imagick = new Imagick($pdfPath); + $imagick->setImageFormat('png'); + file_put_contents($imagePath, $imagick); + + assertMatchesImageSnapshot($imagePath); +} diff --git a/tests/TestCase.php b/tests/TestCase.php index 93dddad..ad9c570 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -5,6 +5,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Orchestra\Testbench\TestCase as Orchestra; use Spatie\LaravelPdf\LaravelPdfServiceProvider; +use Spatie\LaravelPdf\PdfServiceProvider; class TestCase extends Orchestra { @@ -12,25 +13,13 @@ protected function setUp(): void { parent::setUp(); - Factory::guessFactoryNamesUsing( - fn (string $modelName) => 'Spatie\\LaravelPdf\\Database\\Factories\\'.class_basename($modelName).'Factory' - ); + $this->app->view->addLocation(__DIR__.'/TestSupport/Views'); } protected function getPackageProviders($app) { return [ - LaravelPdfServiceProvider::class, + PdfServiceProvider::class, ]; } - - public function getEnvironmentSetUp($app) - { - config()->set('database.default', 'testing'); - - /* - $migration = include __DIR__.'/../database/migrations/create_laravel-pdf_table.php.stub'; - $migration->up(); - */ - } } diff --git a/tests/TestSupport/Views/test.blade.php b/tests/TestSupport/Views/test.blade.php new file mode 100644 index 0000000..1b6bdd0 --- /dev/null +++ b/tests/TestSupport/Views/test.blade.php @@ -0,0 +1,3 @@ +
+ This is a test +
diff --git a/tests/__snapshots__/PdfTest__it_can_accept_margins__1.png b/tests/__snapshots__/PdfTest__it_can_accept_margins__1.png new file mode 100644 index 0000000000000000000000000000000000000000..da8136eda5bfc77b5cf7721134b54eed0c2f0d48 GIT binary patch literal 3319 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 F69AOn)6f6_ literal 0 HcmV?d00001 diff --git a/tests/__snapshots__/PdfTest__it_can_accept_the_paper_format__1.png b/tests/__snapshots__/PdfTest__it_can_accept_the_paper_format__1.png new file mode 100644 index 0000000000000000000000000000000000000000..4f8848cf2903b2d0207299495ff2071632cab9ce GIT binary patch literal 5210 zcmeAS@N?(olHy`uVBq!ia0y~yVD@5QU|Gh&0uzz`*b-fq}tl1_Oh5!JJ)zHb4ocByV>YhX3vTXZ8bmoCO|{#X#BvjNMLV z+W{HuC7!;n?9X{5`ApEaktaqI2fi@ws45)BvY!)`O^DNb?l^59eT|0>?A z1FcxZ;?SnSI6={iA*DlzK@!R>6k7W9?0Np{>HhoW7=EnZb4&B?`Mk8UVr%33{(X1m z+W!6XCi?V#3#J4A&w5UI_x$qb7pL!>KkDyy^WU*I_a6ISx94M!nd9>E^6Za?*Q6O2 z{|UdBHZ4-V-28dE`Q}-vX8P;4&YPLK@9fhx&pxL7{deMU^?y+YkBEEse&@}+TUcU# zJMw(qw#~Edp3wo?`1-l%^Yrk~wPwfN?blV>#;04)-f11Vzi0M)#tq-QHQvVk{bv#W z`RCETS9ji|T{AY$UsQ6#^R3^tZXpKt{gO-H+MG$VJM;Er*X5h3dCyO;zVT*p$&AXK zaZ?y9ezc$0v_1RqEywN06{g~!fBvYt`19sW%imfT+ka-yd-mx~6@!KF(p0|u%lDoq zr=@*O`eX9?vE9o*Z{FTHb2;YB+3wYGXTRP#dp73W_3+p0Yp!uNq<8E8WL|J6w~gV1 zfGUHL3ugmQAd`aglu_JNjO>(j+TU@CE;jEI9d{pmV~1v z;b=)XGE2f9`{xh$&SzqH^Ox89QTfNSyHYj)N4-=_Tq89{-gUjyA oK;wAAFfC!JMa7xI(3)EF2VS{N99 z0fib~Fff!FFfhDIU|_JC!N4G1FlSew4N!t9$=lt9;eUJonf*W>XMsm#F_88EW4Dvp zc0dMuiKnkC`*R*iK1JO(s|17?7&u;gx;TbZ+a#BHVMd1ud@IeYr!?Dz`5ipM`Ezp0!1)!_bl^LKH5_xFCD@pQTQ1KH@5@7Ik# zKmGUU>cq>tAD^+=ch8=$CZYSyub;mX%jcxdwAA~Z`s{1P9o^$IXWl&j>H5=mANSlp z|LMc-`^^6fPyb4bdgu51>z3$r%QJOzD^1_+lmGs@?ELKY%OBsZ+;8#oB>O+fo4aEF z?fF%+H+TET9rG*ua%Rr_x<_16{%2&$^7hBe4_9vNJ^k?XC*@70X}7z3`uF^u|0dJV zc=>Y6v+o{#E{x83eCBljdjI?L^y0sLSYPL|?Tk^e!C8<`)MX5lF!N|bKSl7@<*T^))(8S8v*viCI z+rYrez@XUqOg4&!-29Zxv`X9>nB+>X12t&CZ79jiO)V}-%q_sJCzLxB)a+9L=_yD_ zv+~FcN-cKEFU?EI%u9F5uV64UG^#MSG}1QEHkd!RHXNu{7^XHXwWv5VKaU~6#ZA{x U&qT#A3nb0p>FVdQ&MBb@0C;_RNdN!< literal 0 HcmV?d00001 diff --git a/tests/__snapshots__/PdfTest__it_can_customize_browsershot__1.png b/tests/__snapshots__/PdfTest__it_can_customize_browsershot__1.png new file mode 100644 index 0000000000000000000000000000000000000000..8dff7a3d9d655bf9ebb85276f617421010049db8 GIT binary patch literal 2214 zcmeAS@N?(olHy`uVBq!ia0y~yV3uHDU`pWt3NUPMys-^PDI|LY`7$t6sWC7#v@kII z0tz*}U|=XUU|@Kaz`$TNgMmT3V9u^U8=wSJlDE4H!~gdFGy8!&&H|6fVj%4S#%?FG z?SKsS5>H=O_UAm3{6Z4`8*ZBcMYKF!978H@y}flYSBg`_;iCENMomS%gV9aV9o`(O zN9MW&G;L?u&AR=8kQ3)-`JQC;T|XmTy~O4!x5(u)96Te7bdq@bh zFgn7CMDFBDQ)A=u{NwNc9WFlf|K4l$V~?#~C+?e!#{a!}#B<{x_%hK#@ zP`v{*-7PkAzP--eey(W7U#rh~cWQ0lU4J{Te7^tj_Rn>Nn?%K595=Z3_S5&X z$8YEE?mhnZOt!@7Gi#pjHQ3=|&;9sI$)5rX{cVMoHBtLoH=fI>PAur$_h0^Ts-N-l z>6T~Ty?R_2o%8t2?fy>w|9fKgzkT?qhC6v?>a(gczm0Xkxq!^40jEr>+jdYDnLkvx=3@xmTOtcLQtPBkD97A8DXvob^ z$xN%ntwCPqZ8%Va2Hb{{%-q!ClEmBs+C*r8)zG_Kgiw%R4WWq8