assertSeeLiveWire - method not found #2129
Answered
by
calebdw
finn-matti
asked this question in
Q&A
-
I have the following test code: $user = User::factory()->create();
$this->actingAs($user)
->get('bookmarks')
->assertSuccessful()
->assertSeeLivewire('pages.bookmarks'); Which gives the following error: Am I just doing something wrong? Or did I discover a bug? I tried to search for similar issues, but I wasn't sure. So here we are. I have larastan 3.0 installed and updated. I am running on PHP 8.3 and am using Laravel 11 and Livewire 3.5 |
Beta Was this translation helpful? Give feedback.
Answered by
calebdw
Nov 26, 2024
Replies: 1 comment 10 replies
-
It may be an unknown macro |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The test macros are registered when the Livewire service provider is booted---however, the SupportTesting component hook early returns when the environment is not
testing
:https://github.com/livewire/livewire/blob/047904314adc8a27046d042959a4c29c0feea6e2/src/Features/SupportTesting/SupportTesting.php#L12-L14
You likely are not running PHPStan in the
testing
environment so the custom macros are not being registered. Updating my.env
to betesting
allowed phpstan to discover the method