Error running tests: Call to a member function getId() on null
laravel v10
filament v3
pest
project was updated from L9 and F2
One of the test that fails with that message: Tests\Feature\Back\Files\CreateTest.php
tests\TestCase.php
Thank you
Solution:Jump to solution
so i had an error that the login route is not refined (both 'filament.admin.auth.login' or 'filament.auth.login'). and it is not listed in route:list . To login i'm directed to the old application login.
I need to do a bit digging first, try and setup the regular filament login. and then see if this issue was fixed.
thank you for the help!...
10 Replies
a screenshot of the test error:
my admin panel is registered and, on the browser, the application works as expected
->assertRedirect(route('filament.admin.auth.login'))
?the same error pressists
what about this?
Solution
so i had an error that the login route is not refined (both 'filament.admin.auth.login' or 'filament.auth.login'). and it is not listed in route:list . To login i'm directed to the old application login.
I need to do a bit digging first, try and setup the regular filament login. and then see if this issue was fixed.
thank you for the help!
weird, because you said my admin panel is registered and, on the browser, the application works as expected...
yes. it was working perfectly. I'm running the tests again, and will check how a 2 lines change went
ok. so i am now using filament login!
i just added the login method on the panel. and commented my old login route on the routes file
do i need to add the $currentPanel and the setcurrentpanel in all these tests that are failing?
you are kidding me.. Didn't you set ->login() on the Panel? 😅
nop 😅 i never saw that on the docs
and it's a bigger facepalm i just realized now (and am on my way to launch a filament product) 😵💫