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
Did you register a panel provider in your base TestCase?
Dhruva
DhruvaOP2y 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
Yeah, it could be missing from the documentation... Can you share what you have in TestCase?
ana
ana15mo 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
toeknee15mo ago
Please create a new post with your test case code.
ana
ana15mo ago
thank you!

Did you find this page helpful?