Closed (fixed)
Project:
Entity Extra Field
Version:
2.1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2026 at 06:51 UTC
Updated:
30 Mar 2026 at 15:30 UTC
Jump to comment: Most recent
The module currently only seems to have very basic tests, but is complex and should have tests to ensure it works as expected.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
velmir_taky commentedAdded kernel tests for the main module functionality:
- Config entity CRUD, computed ID, display methods, field type accessors
-
hook_entity_extra_field_info()for both view and form displays- Theme suggestions hook
- Plugin manager discovery and instantiation for all 6 plugin types
- Token plugin build with different configurations
- Condition evaluation logic (all/any pass, empty conditions)
PHPStan failure is not related to this MR — those are pre-existing errors in
ConfigTranslation/EntityExtraFieldMapper.php(see #3575357).Comment #5
anybodyThanks @velmir_taky, great work!
We should also have functional tests for the UI in the fields area, I think.
Comment #6
velmir_taky commentedThanks @anybody!
Added functional tests for the UI as you requested.
Also added FunctionalJavascript tests for the AJAX add form.
All 32 module tests pass.
Please review when you get a chance.
Comment #7
anybodyComment #8
anybody@velmir_taky would be very helpful to also have tests checking the views display of entity_extra_field with and without using arguments and tokens.
Comment #9
velmir_taky commentedAdded kernel tests for the Views plugin as requested in #8.
The new
ExtraFieldViewsPluginTestcovers:- Rendering a view as an extra field without arguments
- Token-based arguments (
[node:nid]resolving to the actual node ID)- Static arguments
- Multiple comma-separated arguments (token + static combined)
- Empty view output when no results match
- Default plugin configuration
Comment #10
anybodyNice! Even if it's probably AI-generated (right?), it looks useful to me and covers a bunch of code. Thanks!
@grevil would you take a rough look and merge if it's fine (enough)?
Comment #11
grevil commentedNeeds rebase.
Comment #12
grevil commentedLGTM, made some adjustments.
Comment #13
grevil commentedLet's wait for the tests to pass.
Comment #14
grevil commentedAll green! Merging.