© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
3 replies
ModestasV

Testing Filament Relation Manager

Hey,

Currently, I have an issue with Relation Manager testing. Here's the two problems I have:

1.
RelationManager::form(): Argument #1 ($form) must be of type Filament\Forms\Form, Filament\Infolists\Infolist given,
RelationManager::form(): Argument #1 ($form) must be of type Filament\Forms\Form, Filament\Infolists\Infolist given,
- this comes from the code below
2. I have no idea which method actually submits the form 🙂

Does anyone have any experience or examples how to test relation managers?

So far, I have this:

 livewire(FieldsRelationManager::class, [
        'ownerRecord' => $crud,
        'pageClass' => EditCrud::class,
    ])
        ->fillForm([
            'type' => CrudFieldTypes::TEXT,
            'validation' => CrudFieldValidation::REQUIRED,
            'label' => 'Test Field',
            'tooltip' => 'Test Tooltip',
            'in_create' => true,
            'in_edit' => true,
            'in_list' => true,
        ])
        ->assertSuccessful();
 livewire(FieldsRelationManager::class, [
        'ownerRecord' => $crud,
        'pageClass' => EditCrud::class,
    ])
        ->fillForm([
            'type' => CrudFieldTypes::TEXT,
            'validation' => CrudFieldValidation::REQUIRED,
            'label' => 'Test Field',
            'tooltip' => 'Test Tooltip',
            'in_create' => true,
            'in_edit' => true,
            'in_list' => true,
        ])
        ->assertSuccessful();


And it successfully loads the relation manager as long as I don't have a form, but as soon as I do - it crashes. It might be that I am incorrectly setting the parameters, but I'm unsure.

I have tried looking at the documentation, but I'm probably blind and could not find anything related. I took a look at google search and most of the same issue were on custom Livewire pages.

Reference:
https://filamentphp.com/docs/3.x/tables/testing
https://laracasts.com/discuss/channels/laravel/testing-filamentphp-error-filamentinfolistsinfolist-given
https://github.com/filamentphp/filament/discussions/8962

Ideas are welcome much appreciated!
Testing - Table Builder - Filament
Laracasts
GitHub
Testing FilamentPHP Error - Filament\Infolists\Infolist given · fil...
Hello all, I made filament custom page with a form and some logic. Please find the code of the page below. The form is working properly. However, when I set some test (code below), I have an error ...
Testing FilamentPHP Error - Filament\Infolists\Infolist given · fil...
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Filament Relation Manager
FilamentFFilament / ❓┊help
3y ago
Testing relation manager actions
FilamentFFilament / ❓┊help
12mo ago
Testing Relation Managers
FilamentFFilament / ❓┊help
17mo ago
Testing relation managers
FilamentFFilament / ❓┊help
2y ago