[plugins-dev] test: isDeferred does not exist

any idea why I am getting Method Filament\Panel::isDeferred does not exist. when testing a plugin! I think I am missing a provider or something?! the test:
get(CategoryResource::getUrl('index'))->assertSuccessful();
get(CategoryResource::getUrl('index'))->assertSuccessful();
result:
⨯ it can render Category List
────────────────────────────────────────────────────────────────────────────────
FAILED Tests\ResourcesTest > it can render Category… BadMethodCallException
Method Filament\Panel::isDeferred does not exist.

at vendor/filament/support/src/Concerns/Macroable.php:72
68▕ {
69▕ $macro = static::getMacro($method);
70▕
71▕ if ($macro === null) {
➜ 72▕ throw new BadMethodCallException(sprintf(
73▕ 'Method %s::%s does not exist.',
74▕ static::class,
75▕ $method,
76▕ ));

+10 vendor frames
11 tests/TestCase.php:38
⨯ it can render Category List
────────────────────────────────────────────────────────────────────────────────
FAILED Tests\ResourcesTest > it can render Category… BadMethodCallException
Method Filament\Panel::isDeferred does not exist.

at vendor/filament/support/src/Concerns/Macroable.php:72
68▕ {
69▕ $macro = static::getMacro($method);
70▕
71▕ if ($macro === null) {
➜ 72▕ throw new BadMethodCallException(sprintf(
73▕ 'Method %s::%s does not exist.',
74▕ static::class,
75▕ $method,
76▕ ));

+10 vendor frames
11 tests/TestCase.php:38
the same testing was green with v2. full changes: https://github.com/lara-zeus/bolt/pull/106
Solution:
You’ll need to update the providers in your TestCase have a look here. https://github.com/filamentphp/plugin-skeleton
GitHub
GitHub - filamentphp/plugin-skeleton: A package skeleton for develo...
A package skeleton for developing Filament plugins. - GitHub - filamentphp/plugin-skeleton: A package skeleton for developing Filament plugins.
Jump to solution
3 Replies
Solution
awcodes
awcodes16mo ago
You’ll need to update the providers in your TestCase have a look here. https://github.com/filamentphp/plugin-skeleton
GitHub
GitHub - filamentphp/plugin-skeleton: A package skeleton for develo...
A package skeleton for developing Filament plugins. - GitHub - filamentphp/plugin-skeleton: A package skeleton for developing Filament plugins.
awcodes
awcodes16mo ago
Look at the 3.x branch
Lara Zeus
Lara ZeusOP16mo ago
thanks @awcodes
I compear the providers, i added Filament\Panel::class removed it and I got GREEEEEN 🙂
Want results from more Discord servers?
Add your server