Skip to content

Commit

Permalink
Added support for Laravel 9 (#4)
Browse files Browse the repository at this point in the history
Added support for Laravel 9
  • Loading branch information
swapnilsarwe authored Feb 4, 2022
1 parent 53c9d67 commit bea76ba
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [7.4, 8.0]
laravel: [^8.0]
php: [7.4, '8.0', 8.1]
laravel: [8, 9]
exclude:
- php: 7.4
laravel: 9

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}

Expand All @@ -30,7 +33,8 @@ jobs:

- name: Install dependencies
run: |
composer require "illuminate/contracts=${{ matrix.laravel }}" --prefer-dist --no-interaction --no-update
composer require "illuminate/contracts=^${{ matrix.laravel }}" --prefer-dist --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/phpunit --verbose
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
],
"require": {
"php": "^7.4|^8.0",
"blade-ui-kit/blade-icons": "^1.0",
"illuminate/support": "^8.0"
"blade-ui-kit/blade-icons": "^1.1",
"illuminate/support": "^8.0|^9.0"
},
"require-dev": {
"codeat3/blade-icon-generation-helpers": "dev-poc",
"codeat3/phpcs-styles": "dev-main",
"orchestra/testbench": "^6.0",
"codeat3/blade-icon-generation-helpers": "^0.1",
"codeat3/phpcs-styles": "^1.0",
"orchestra/testbench": "^6.0|^7.0",
"phpunit/phpunit": "^9.0"
},
"autoload": {
Expand Down
10 changes: 5 additions & 5 deletions tests/CompilesIconsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function it_compiles_a_single_anonymous_component()

// Note: the empty class here seems to be a Blade components bug.
$expected = <<<'SVG'
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2 -1.5 24 24" preserveAspectRatio="xMinYMin" fill="currentColor"><path d="M10 20.393c-5.523 0-10-4.477-10-10 0-5.522 4.477-10 10-10s10 4.478 10 10c0 5.523-4.477 10-10 10zm0-15a1 1 0 0 0-1 1v5a1 1 0 0 0 2 0v-5a1 1 0 0 0-1-1zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2 -1.5 24 24" fill="currentColor"><path d="M10 20.393c-5.523 0-10-4.477-10-10 0-5.522 4.477-10 10-10s10 4.478 10 10c0 5.523-4.477 10-10 10zm0-15a1 1 0 0 0-1 1v5a1 1 0 0 0 2 0v-5a1 1 0 0 0-1-1zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/></svg>
SVG;

$this->assertSame($expected, $result);
Expand All @@ -30,7 +30,7 @@ public function it_can_add_classes_to_icons()
$result = svg('jam-alert-f', 'w-6 h-6 text-gray-500')->toHtml();

$expected = <<<'SVG'
<svg class="w-6 h-6 text-gray-500" xmlns="http://www.w3.org/2000/svg" viewBox="-2 -1.5 24 24" preserveAspectRatio="xMinYMin" fill="currentColor"><path d="M10 20.393c-5.523 0-10-4.477-10-10 0-5.522 4.477-10 10-10s10 4.478 10 10c0 5.523-4.477 10-10 10zm0-15a1 1 0 0 0-1 1v5a1 1 0 0 0 2 0v-5a1 1 0 0 0-1-1zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/></svg>
<svg class="w-6 h-6 text-gray-500" xmlns="http://www.w3.org/2000/svg" viewBox="-2 -1.5 24 24" fill="currentColor"><path d="M10 20.393c-5.523 0-10-4.477-10-10 0-5.522 4.477-10 10-10s10 4.478 10 10c0 5.523-4.477 10-10 10zm0-15a1 1 0 0 0-1 1v5a1 1 0 0 0 2 0v-5a1 1 0 0 0-1-1zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/></svg>
SVG;

$this->assertSame($expected, $result);
Expand All @@ -42,7 +42,7 @@ public function it_can_add_styles_to_icons()
$result = svg('jam-alert-f', ['style' => 'color: #555'])->toHtml();

$expected = <<<'SVG'
<svg style="color: #555" xmlns="http://www.w3.org/2000/svg" viewBox="-2 -1.5 24 24" preserveAspectRatio="xMinYMin" fill="currentColor"><path d="M10 20.393c-5.523 0-10-4.477-10-10 0-5.522 4.477-10 10-10s10 4.478 10 10c0 5.523-4.477 10-10 10zm0-15a1 1 0 0 0-1 1v5a1 1 0 0 0 2 0v-5a1 1 0 0 0-1-1zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/></svg>
<svg style="color: #555" xmlns="http://www.w3.org/2000/svg" viewBox="-2 -1.5 24 24" fill="currentColor"><path d="M10 20.393c-5.523 0-10-4.477-10-10 0-5.522 4.477-10 10-10s10 4.478 10 10c0 5.523-4.477 10-10 10zm0-15a1 1 0 0 0-1 1v5a1 1 0 0 0 2 0v-5a1 1 0 0 0-1-1zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/></svg>
SVG;

$this->assertSame($expected, $result);
Expand All @@ -56,7 +56,7 @@ public function it_can_add_default_class_from_config()
$result = svg('jam-alert-f')->toHtml();

$expected = <<<'SVG'
<svg class="awesome" xmlns="http://www.w3.org/2000/svg" viewBox="-2 -1.5 24 24" preserveAspectRatio="xMinYMin" fill="currentColor"><path d="M10 20.393c-5.523 0-10-4.477-10-10 0-5.522 4.477-10 10-10s10 4.478 10 10c0 5.523-4.477 10-10 10zm0-15a1 1 0 0 0-1 1v5a1 1 0 0 0 2 0v-5a1 1 0 0 0-1-1zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/></svg>
<svg class="awesome" xmlns="http://www.w3.org/2000/svg" viewBox="-2 -1.5 24 24" fill="currentColor"><path d="M10 20.393c-5.523 0-10-4.477-10-10 0-5.522 4.477-10 10-10s10 4.478 10 10c0 5.523-4.477 10-10 10zm0-15a1 1 0 0 0-1 1v5a1 1 0 0 0 2 0v-5a1 1 0 0 0-1-1zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/></svg>
SVG;

$this->assertSame($expected, $result);
Expand All @@ -71,7 +71,7 @@ public function it_can_merge_default_class_from_config()
$result = svg('jam-alert-f', 'w-6 h-6')->toHtml();

$expected = <<<'SVG'
<svg class="awesome w-6 h-6" xmlns="http://www.w3.org/2000/svg" viewBox="-2 -1.5 24 24" preserveAspectRatio="xMinYMin" fill="currentColor"><path d="M10 20.393c-5.523 0-10-4.477-10-10 0-5.522 4.477-10 10-10s10 4.478 10 10c0 5.523-4.477 10-10 10zm0-15a1 1 0 0 0-1 1v5a1 1 0 0 0 2 0v-5a1 1 0 0 0-1-1zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/></svg>
<svg class="awesome w-6 h-6" xmlns="http://www.w3.org/2000/svg" viewBox="-2 -1.5 24 24" fill="currentColor"><path d="M10 20.393c-5.523 0-10-4.477-10-10 0-5.522 4.477-10 10-10s10 4.478 10 10c0 5.523-4.477 10-10 10zm0-15a1 1 0 0 0-1 1v5a1 1 0 0 0 2 0v-5a1 1 0 0 0-1-1zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/></svg>
SVG;

$this->assertSame($expected, $result);
Expand Down

0 comments on commit bea76ba

Please sign in to comment.