Skip to content

Commit

Permalink
Get working with Livewire V3
Browse files Browse the repository at this point in the history
  • Loading branch information
joshhanley committed Jan 18, 2024
1 parent 8b6cef9 commit a2648f7
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 351 deletions.
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
],
"require": {
"php": "^7.4|^8.0",
"livewire/livewire": "^2.3|dev-master",
"orchestra/testbench-dusk": "^5.2|^6.7|^7.0|^8.0",
"livewire/livewire": "^3.1|dev-master",
"orchestra/testbench-dusk": "^8.0|^9.0",
"psy/psysh": "^0.11.1"
},
"require-dev": {
"spatie/laravel-ray": "^1.10"
},
"autoload": {
"psr-4": {
"LivewireDuskTestbench\\": "src/"
Expand All @@ -25,8 +28,5 @@
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"require-dev": {
"spatie/laravel-ray": "^1.10"
}
"prefer-stable": true
}
9 changes: 1 addition & 8 deletions src/LivewireDuskTestbenchServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace LivewireDuskTestbench;

use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
use Illuminate\Testing\Constraints\SeeInOrder;
use Laravel\Dusk\Browser;
Expand All @@ -12,12 +11,6 @@ class LivewireDuskTestbenchServiceProvider extends ServiceProvider
{
public function boot()
{
Route::get('/livewire-dusk/{component}', function ($component) {
$class = urldecode($component);

return app()->call(new $class());
})->middleware('web');

Browser::macro('assertSeeInOrder', function ($selector, $contents) {
$fullSelector = $this->resolver->format($selector);

Expand All @@ -26,7 +19,7 @@ public function boot()
$contentsString = implode(', ', $contents);

PHPUnit::assertThat(
array_map('e', ($contents)),
array_map('e', $contents),
new SeeInOrder($element->getText()),
"Did not see expected contents [{$contentsString}] within element [{$fullSelector}]."
);
Expand Down
Loading

0 comments on commit a2648f7

Please sign in to comment.