From b5521f17c7d8afdbcd312f166c2d463eabef5d4d Mon Sep 17 00:00:00 2001 From: Owen Voke Date: Fri, 25 Aug 2023 10:09:56 +0100 Subject: [PATCH 1/4] chore(deps): update Pint to 1.11.x --- composer.json | 2 +- tests/CompilesIconsTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 21b54db..045ba7f 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "illuminate/support": "^9.0|^10.0" }, "require-dev": { - "laravel/pint": "^1.5", + "laravel/pint": "^1.11", "orchestra/testbench": "^7.22|^8.0", "pestphp/pest": "^1.22.3", "phpstan/phpstan": "^1.9.17", diff --git a/tests/CompilesIconsTest.php b/tests/CompilesIconsTest.php index 5e0a6f7..17e94f2 100644 --- a/tests/CompilesIconsTest.php +++ b/tests/CompilesIconsTest.php @@ -3,6 +3,7 @@ declare(strict_types=1); use OwenVoke\BladeEntypo\Tests\TestCase; + use function Spatie\Snapshots\assertMatchesSnapshot; uses(TestCase::class); From d3211828e7f738be2c6051bac007e2959c53cc4e Mon Sep 17 00:00:00 2001 From: Owen Voke Date: Fri, 25 Aug 2023 10:15:34 +0100 Subject: [PATCH 2/4] chore(deps): update Composer dependencies --- .github/workflows/tests.yml | 3 +-- README.md | 8 ++++---- composer.json | 14 +++++++------- phpunit.xml.dist | 15 +++++---------- 4 files changed, 17 insertions(+), 23 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7a8c543..81b912d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - php: ['8.0', '8.1', '8.2'] + php: ['8.1', '8.2'] dependency-version: [prefer-lowest, prefer-stable] name: PHP ${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} @@ -22,7 +22,6 @@ jobs: with: php-version: ${{ matrix.php }} extensions: fileinfo - tools: composer coverage: none - name: Setup Problem Matches diff --git a/README.md b/README.md index a1be856..792c0b9 100644 --- a/README.md +++ b/README.md @@ -21,15 +21,15 @@ Please see the [upgrade guide](UPGRADE.md) for information on how to upgrade to ## Requirements -- PHP 8.0 or higher -- Laravel 9.0 or higher +- PHP 8.1 or higher +- Laravel 10.x or higher ## Install Via Composer ```shell -$ composer require owenvoke/blade-entypo +composer require owenvoke/blade-entypo ``` ## Configuration @@ -85,7 +85,7 @@ Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed re ## Testing ```bash -$ composer test +composer test ``` ## Contributing diff --git a/composer.json b/composer.json index 045ba7f..3aaa9cc 100644 --- a/composer.json +++ b/composer.json @@ -4,17 +4,17 @@ "description": "A package to easily make use of Entypo in your Laravel Blade views", "license": "MIT", "require": { - "php": "^8.0", + "php": "^8.1", "blade-ui-kit/blade-icons": "^1.5", - "illuminate/support": "^9.0|^10.0" + "illuminate/support": "^10.0" }, "require-dev": { "laravel/pint": "^1.11", - "orchestra/testbench": "^7.22|^8.0", - "pestphp/pest": "^1.22.3", - "phpstan/phpstan": "^1.9.17", - "spatie/pest-plugin-snapshots": "^1.0.1", - "symfony/var-dumper": "^6.0" + "orchestra/testbench": "^8.5", + "pestphp/pest": "^2.16", + "phpstan/phpstan": "^1.10", + "spatie/pest-plugin-snapshots": "^2.0", + "symfony/var-dumper": "^6.3" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index b0440a1..8d77cf6 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,22 +1,17 @@ - + cacheDirectory=".phpunit.cache"> tests - + src - + From cd4321e097913364c71ad1bc37dabdb7ce10cf79 Mon Sep 17 00:00:00 2001 From: Owen Voke Date: Fri, 25 Aug 2023 10:18:55 +0100 Subject: [PATCH 3/4] feat: update to use Safe PHP --- composer.json | 6 ++++-- config/generation.php | 6 +++++- phpstan.neon.dist | 3 +++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 3aaa9cc..f1d9225 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,8 @@ "require": { "php": "^8.1", "blade-ui-kit/blade-icons": "^1.5", - "illuminate/support": "^10.0" + "illuminate/support": "^10.0", + "thecodingmachine/safe": "^2.5" }, "require-dev": { "laravel/pint": "^1.11", @@ -14,7 +15,8 @@ "pestphp/pest": "^2.16", "phpstan/phpstan": "^1.10", "spatie/pest-plugin-snapshots": "^2.0", - "symfony/var-dumper": "^6.3" + "symfony/var-dumper": "^6.3", + "thecodingmachine/phpstan-safe-rule": "^1.2" }, "autoload": { "psr-4": { diff --git a/config/generation.php b/config/generation.php index 8159b32..8006018 100644 --- a/config/generation.php +++ b/config/generation.php @@ -1,10 +1,14 @@ Date: Fri, 25 Aug 2023 10:20:07 +0100 Subject: [PATCH 4/4] chore: update to use Pest built-in snapshots --- composer.json | 1 - .../CompilesIconsTest/it_can_add_classes_to_icons.snap} | 0 .../CompilesIconsTest/it_can_add_styles_to_icons.snap} | 0 .../it_compiles_a_single_anonymous_component.snap} | 0 tests/CompilesIconsTest.php | 8 +++----- 5 files changed, 3 insertions(+), 6 deletions(-) rename tests/{__snapshots__/CompilesIconsTest__it_can_add_classes_to_icons__1.txt => .pest/snapshots/CompilesIconsTest/it_can_add_classes_to_icons.snap} (100%) rename tests/{__snapshots__/CompilesIconsTest__it_can_add_styles_to_icons__1.txt => .pest/snapshots/CompilesIconsTest/it_can_add_styles_to_icons.snap} (100%) rename tests/{__snapshots__/CompilesIconsTest__it_compiles_a_single_anonymous_component__1.txt => .pest/snapshots/CompilesIconsTest/it_compiles_a_single_anonymous_component.snap} (100%) diff --git a/composer.json b/composer.json index f1d9225..f0d21c2 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,6 @@ "orchestra/testbench": "^8.5", "pestphp/pest": "^2.16", "phpstan/phpstan": "^1.10", - "spatie/pest-plugin-snapshots": "^2.0", "symfony/var-dumper": "^6.3", "thecodingmachine/phpstan-safe-rule": "^1.2" }, diff --git a/tests/__snapshots__/CompilesIconsTest__it_can_add_classes_to_icons__1.txt b/tests/.pest/snapshots/CompilesIconsTest/it_can_add_classes_to_icons.snap similarity index 100% rename from tests/__snapshots__/CompilesIconsTest__it_can_add_classes_to_icons__1.txt rename to tests/.pest/snapshots/CompilesIconsTest/it_can_add_classes_to_icons.snap diff --git a/tests/__snapshots__/CompilesIconsTest__it_can_add_styles_to_icons__1.txt b/tests/.pest/snapshots/CompilesIconsTest/it_can_add_styles_to_icons.snap similarity index 100% rename from tests/__snapshots__/CompilesIconsTest__it_can_add_styles_to_icons__1.txt rename to tests/.pest/snapshots/CompilesIconsTest/it_can_add_styles_to_icons.snap diff --git a/tests/__snapshots__/CompilesIconsTest__it_compiles_a_single_anonymous_component__1.txt b/tests/.pest/snapshots/CompilesIconsTest/it_compiles_a_single_anonymous_component.snap similarity index 100% rename from tests/__snapshots__/CompilesIconsTest__it_compiles_a_single_anonymous_component__1.txt rename to tests/.pest/snapshots/CompilesIconsTest/it_compiles_a_single_anonymous_component.snap diff --git a/tests/CompilesIconsTest.php b/tests/CompilesIconsTest.php index 17e94f2..a5adfc7 100644 --- a/tests/CompilesIconsTest.php +++ b/tests/CompilesIconsTest.php @@ -4,24 +4,22 @@ use OwenVoke\BladeEntypo\Tests\TestCase; -use function Spatie\Snapshots\assertMatchesSnapshot; - uses(TestCase::class); it('compiles a single anonymous component', function () { $result = svg('entypo-plus')->toHtml(); - assertMatchesSnapshot($result); + expect($result)->toMatchSnapshot(); }); it('can add classes to icons', function () { $result = svg('entypo-plus', 'w-6 h-6 text-gray-500')->toHtml(); - assertMatchesSnapshot($result); + expect($result)->toMatchSnapshot(); }); it('can add styles to icons', function () { $result = svg('entypo-plus', ['style' => 'color: #555'])->toHtml(); - assertMatchesSnapshot($result); + expect($result)->toMatchSnapshot(); });