Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.x] Adds L11 support #167

Merged
merged 13 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@ jobs:
fail-fast: false
matrix:
php: [8.1, 8.2, 8.3]
laravel: [10.*]
laravel: [10.*, 11.*]
livewire: [2.11, 3.3.5]
stability: [prefer-lowest, prefer-stable]
os: [ubuntu-latest, windows-latest]
exclude:
- php: 8.1
laravel: 11.*
- laravel: 11.*
livewire: 2.11

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
name: P${{ matrix.php }} - L${{ matrix.laravel }} - LW${{ matrix.livewire }} -${{ matrix.stability }} - ${{ matrix.os }}

steps:
- name: Checkout code
Expand All @@ -41,9 +47,8 @@ jobs:

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "nesbot/carbon:^2.62.1" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest
composer require "laravel/framework:${{ matrix.laravel }}" "nesbot/carbon:^2.72.1" --no-interaction --no-update
composer update --with="livewire/livewire:^${{ matrix.livewire }}" --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest

- name: Execute tests
run: vendor/bin/pest

17 changes: 9 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"illuminate/support": "^10.0",
"illuminate/support": "^10.0|^11.0",
"spatie/flare-client-php": "^1.3.5",
"spatie/ignition": "^1.9",
"symfony/console": "^6.2.3",
"symfony/var-dumper": "^6.2.3"
"symfony/console": "^6.2.3|^7.0",
"symfony/var-dumper": "^6.2.3|^7.0"
},
"require-dev": {
"livewire/livewire": "^2.11",
"livewire/livewire": "^2.11|^3.3.5",
"mockery/mockery": "^1.5.1",
"openai-php/client": "^0.3.4",
"orchestra/testbench": "^8.0",
"pestphp/pest": "^1.22.3",
"openai-php/client": "^0.8.1",
"orchestra/testbench": "^8.0|^9.0",
"pestphp/pest": "^2.30",
"phpstan/extension-installer": "^1.2",
"phpstan/phpstan-deprecation-rules": "^1.1.1",
"phpstan/phpstan-phpunit": "^1.3.3",
Expand All @@ -46,7 +46,8 @@
"sort-packages": true,
"allow-plugins": {
"phpstan/extension-installer": true,
"pestphp/pest-plugin": true
"pestphp/pest-plugin": true,
"php-http/discovery": false
}
},
"extra": {
Expand Down
32 changes: 26 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<testsuites>
<testsuite name="Flare Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
backupGlobals="false"
bootstrap="vendor/autoload.php"
colors="true"
processIsolation="false"
stopOnFailure="false"
executionOrder="random"
failOnWarning="true"
failOnRisky="true"
failOnEmptyTestSuite="true"
beStrictAboutOutputDuringTests="true"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
>
<testsuites>
<testsuite name="Laravel Ignition Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

beforeEach(function () {
$this->livewireManager = FakeLivewireManager::setUp();
});
})->skip(LIVEWIRE_VERSION_3, 'Missing Livewire 3 support.');

it('returns the referer url and method', function () {
$context = createRequestContext([
Expand Down Expand Up @@ -166,7 +166,7 @@ function createRequestContext(array $fingerprint, array $updates = [], array $se
'fingerprint' => $fingerprint,
'serverMemo' => $serverMemo,
'updates' => $updates,
]);
], ['X-Livewire' => 1]);

return new LaravelLivewireRequestContextProvider($providedRequest, test()->livewireManager);
}
3 changes: 3 additions & 0 deletions tests/Pest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php

use Dotenv\Dotenv;
use Livewire\Mechanisms\ComponentRegistry;
use Spatie\LaravelIgnition\Tests\TestCase;

define('LIVEWIRE_VERSION_3', class_exists(ComponentRegistry::class));

uses(TestCase::class)->in(__DIR__);

if (file_exists(__DIR__ . '/../.env')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

expect($solution->getSolutionTitle())->toBe('Possible typo `Spatie\LaravelIgnition\Tests\stubs\Components\TestLivewireComponent::chnge`');
expect($solution->getSolutionDescription())->toBe('Did you mean `Spatie\LaravelIgnition\Tests\stubs\Components\TestLivewireComponent::change`?');
});
})->skip(LIVEWIRE_VERSION_3, 'Missing Livewire 3 support.');
nunomaduro marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TestCase extends \Orchestra\Testbench\TestCase

protected function setUp(): void
{
ray()->newScreen($this->getName());
// ray()->newScreen($this->getName());

parent::setUp();
}
Expand Down
Loading