Closed (outdated)
Project:
Drupal core
Version:
11.x-dev
Component:
field system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
2 Jan 2014 at 15:23 UTC
Updated:
10 Aug 2024 at 11:43 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
kristiaanvandeneyndeWhoops, Dreditor...
Comment #2
kristiaanvandeneyndeFound it in D8! :)
The extra fields now use EntityDisplay objects along with regular fields: https://drupal.org/node/1875952
So I did some digging and found the D8 functionality in Drupal\field_ui\DisplayOverviewBase::buildExtraFieldRow(). See the code (line 447).
So it could very well be that there are tests already for D8, but that they now are more generic tests for EntityDisplay objects.
(Cross-posting in related issue)
Comment #3
andypostD7 has own issue, seems we need to test entity display and maybe for entity form
Tagged properly, novice:
1) check for tests of entity displays, extra fields now could be in 'content' or 'hidden' sections
2) make sure that both entity form and view displays are covered with tests
Comment #4
kunalgrover05 commentedThere are tests already in EntityDisplayTest class function testExtraFieldComponent() which executes test environment created by entity_test_entity_extra_field_info in entity_test.module, so partially the task is solved already.
To write the same tests for EntityFormDisplayTest we need to be able to load the same info for testing and create a form using that. How to do that?
Comment #5
cilefen commented@kunalgrover05 Thank you for working on this issue. EntityFormDisplayTest already activates the entity_test module so the procedure will be quite similar.
Comment #6
David_Rothstein commentedSeems like the testExtraFieldComponent() method mentioned above does already test this to some extent, since it has this code:
where the test module implements hook_entity_extra_field_info() to mark the first one with 'visible' => TRUE and the second with 'visible' => FALSE.
Comment #7
jp.stacey commentedLooking at this as part of SprintWeekend2016.
Comment #8
jp.stacey commentedI agree with @David_Rothstein that this is implicitly tested already, but the tests for: how a visible field works; how a non-visible field works; what modifying them with
setComponent()does.... It's all coupled together, so more granularity of testing might be good.For comment, and to move this issue along, attached is a patch which splits
testExtraFieldComponent()up, adding a new testtestNonVisibleExtraFieldComponent(). Would appreciate thoughts! This separation should also make clear what needs to be tested for D7.Comment #11
quietone commentedPatch no longer applies.
Comment #12
hardikpandya commentedRerolled patch.
Comment #14
erozqba commentedAll test passed!
Comment #15
jofitzComment #17
erozqba commentedRerolled patch to version 8.4.x
Comment #29
smustgrave commentedTagged for issue summary update 8 years ago and that still needs to happen it seems..
Comment #31
quietone commentedI think this is outdated due to #2796581: Fields must store their region in entity displays