F
Filament16mo ago
Dhruva

Test Error - Call to a member function getId() on null

it('can render product category page', function () {

$this
->actingAs(user())
->get(ProductCategoryResource::getUrl())
->assertSuccessful();
});
it('can render product category page', function () {

$this
->actingAs(user())
->get(ProductCategoryResource::getUrl())
->assertSuccessful();
});
The test fails because, it is not able to find current panel. How can I pass panel in the test. If I have more than one panel, how can I test my resources for separate panels. ? Kindly help.
6 Replies
Patrick Boivin
Patrick Boivin16mo ago
Did you register a panel provider in your base TestCase?
Dhruva
DhruvaOP16mo ago
@pboivin I think I have not registered panel provider in base TestCase. I am not able to find any documentation on this 🤔
Patrick Boivin
Patrick Boivin16mo ago
Yeah, it could be missing from the documentation... Can you share what you have in TestCase?
ana
ana14mo ago
Hi! I am having the same error after upgrading to v3, is there documentation on this now? I can't find anything on this issue
toeknee
toeknee14mo ago
Please create a new post with your test case code.
ana
ana14mo ago
thank you!
Want results from more Discord servers?
Add your server