Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is a follow-up for #2737719: EntityResource: Provide comprehensive test coverage: for every entity type, every format, every method.
It was deemed wiser to only apply this new test coverage to all entity types that already had some test coverage in the existing REST tests:
Node
,User
,Term
,EntityTest
,Comment
,Block
,ConfigTest
,Role
andVocabulary
.
All other entity types are deferred to a follow-up […]
This is that follow-up.
Entity types to add test coverage for here:
- Content entity types
-
MenuLinkContent
: #2832859: Write EntityResourceTestBase subclasses for: MenuLinkContent Assigned to: webfloBlockContent
: #2835845: EntityResource: Provide comprehensive test coverage for BlockContent entityFile
: #2843139: EntityResource: Provide comprehensive test coverage for File entity, and tighten access control handlerShortcut
: #2843750: EntityResource: Provide comprehensive test coverage for Shortcut entityItem
: #2843752: EntityResource: Provide comprehensive test coverage for Item entity Assigned to: shadcnContentModerationState
: #2843753: Prevent ContentModerationState from being exposed by REST's EntityResourceFeed
: #2843754: EntityResource: Provide comprehensive test coverage for Feed entity Assigned to: rogierbomMessage
: #2843755: EntityResource: Provide comprehensive test coverage for Message entityMedia
: #2835767: Media + REST: comprehensive test coverage for Media + MediaType entity types
- Config entity types
-
FieldStorageConfig
: #2843756: EntityResource: Provide comprehensive test coverage for FieldStorageConfig entity Assigned to: jamesdeeeFilterFormat
: #2843757: EntityResource: Provide comprehensive test coverage for FilterFormat entityView
: #2843758: EntityResource: Remove ViewAccessControlHandler and provide comprehensive test coverage for View entity Assigned to: jamesdeeeSearchPage
: #2843759: EntityResource: Provide comprehensive test coverage for SearchPage entityConfigurableLanguage
: #2843761: EntityResource: Provide comprehensive test coverage for ConfigurableLanguage entityAction
: #2843762: EntityResource: Provide comprehensive test coverage for Action entityContentLanguageSettings
: #2843763: EntityResource: Provide comprehensive test coverage for ContentLanguageSettings entity Assigned to: shadcnEntityFormDisplay
: #2843764: EntityResource: Provide comprehensive test coverage for EntityFormDisplay entityEntityViewDisplay
: #2843765: EntityResource: Provide comprehensive test coverage for EntityViewDisplay entityFieldConfig
: #2843766: EntityResource: Provide comprehensive test coverage for FieldConfig entityBaseFieldOverride
: #2843767: EntityResource: Provide comprehensive test coverage for BaseFieldOverride entity + add missing access control handler Assigned to: shadcnTour
: #2843768: EntityResource: Provide comprehensive test coverage for Tour entityResponsiveImageStyle
: #2843770: EntityResource: Provide comprehensive test coverage for ResponsiveImageStyle entityRdfMapping
: #2843771: EntityResource: Add an admin permission to RdfMapping entity and provide comprehensive test coverageDateFormat
: #2843772: EntityResource: Provide comprehensive test coverage for DateFormat entityRestResourceConfig
: #2843773: EntityResource: Provide comprehensive test coverage for RestResourceConfig entity Assigned to: Wim LeersBlockContentType
: #2843774: EntityResource: Provide comprehensive test coverage for BlockContentType entity Assigned to: jamesdeeeCommentType
: #2843775: EntityResource: Provide comprehensive test coverage for CommentType entity Assigned to: shadcnEntityTestBundle
: #2843776: EntityResource: Provide comprehensive test coverage for EntityTestBundle entityNodeType
: #2843777: EntityResource: Provide comprehensive test coverage for NodeType entity Assigned to: shadcnContactForm
: #2843778: EntityResource: Provide comprehensive test coverage for ContactForm entityShortcutSet
: #2843779: EntityResource: Provide comprehensive test coverage for ShortcutSet entityEntityFormMode
: #2843780: EntityResource: Provide comprehensive test coverage for EntityFormMode entityEntityViewMode
: #2843781: EntityResource: Provide comprehensive test coverage for EntityViewMode entityEditor
: #2843782: EntityResource: Provide comprehensive test coverage for Editor entity Assigned to: shadcnMenu
: #2843783: EntityResource: Provide comprehensive test coverage for Menu entityModerationStateTransition
: #2843784: EntityResource: Provide comprehensive test coverage for ModerationStateTransition entityWorkflow
: #2843785: EntityResource: Provide comprehensive test coverage for Workflow entityImageStyle
: #2843786: EntityResource: Provide comprehensive test coverage for ImageStyle entityMediaType
: #2835767: Media + REST: comprehensive test coverage for Media + MediaType entity types
Comments
Comment #2
Wim LeersThis should become a plan issue, with child issues for every entity type. Every such child issue can be a novice issue. #2737719: EntityResource: Provide comprehensive test coverage: for every entity type, every format, every method provides lots of examples. If necessary, I can provide an additional example, so that it's clear what every individual issue should do.
Comment #3
harings_rob CreditAttribution: harings_rob commentedAdded the first "subtask". This could also serve as an example.
If it is ok, let me know so that I can create tasks for the others as well.
#2832859: Write EntityResourceTestBase subclasses for: MenuLinkContent
Comment #4
Wim LeersThanks! This is perfect :)
Comment #5
Wim LeersWith #2824576: Delete old REST test coverage: (Read|Create|Update|Delete)Test, deprecate RESTTestBase now also in, this is the perfect time to start pushing this forward! Tweeted about it: https://twitter.com/wimleers/status/808955213612797952.
Comment #6
vijaycs85Comment #7
naveenvalechaComment #8
naveenvalechaCreated child issues for every entity.
Comment #10
Wim LeersComment #11
Wim Leers#2832859: Write EntityResourceTestBase subclasses for: MenuLinkContent landed!
Comment #12
Wim Leers#2843757: EntityResource: Provide comprehensive test coverage for FilterFormat entity landed!
Comment #13
naveenvalecha#2843756: EntityResource: Provide comprehensive test coverage for FieldStorageConfig entity and #2843761: EntityResource: Provide comprehensive test coverage for ConfigurableLanguage entity landed!
Removing the tags because plan issue is not the novice one.
Comment #14
Wim Leers#2843762: EntityResource: Provide comprehensive test coverage for Action entity landed!
Comment #15
naveenvalecha2 more down. #2843759: EntityResource: Provide comprehensive test coverage for SearchPage entity and #2843775: EntityResource: Provide comprehensive test coverage for CommentType entity landed!
Comment #16
Wim LeersAnd #2843756: EntityResource: Provide comprehensive test coverage for FieldStorageConfig entity was reverted.
Comment #17
Wim Leers#2843777: EntityResource: Provide comprehensive test coverage for NodeType entity just landed!
Comment #18
Wim Leers#2843786: EntityResource: Provide comprehensive test coverage for ImageStyle entity, #2843750: EntityResource: Provide comprehensive test coverage for Shortcut entity and #2843752: EntityResource: Provide comprehensive test coverage for Item entity landed!
Comment #19
timmillwoodTicked two off the list.
Comment #20
timmillwoodRe-opened #2843785: EntityResource: Provide comprehensive test coverage for Workflow entity and converted it to workflow entity, which replaced moderation_state and moderation_state_transition.
Comment #21
Wim LeersStill, yay, one less issue to deal with! :)
Comment #22
Wim Leers#2843782: EntityResource: Provide comprehensive test coverage for Editor entity and #2843779: EntityResource: Provide comprehensive test coverage for ShortcutSet entity landed!
Comment #23
Wim LeersOnce we have test coverage for all content entity types, we should add a test that checks that all core content entity types have functional REST test coverage. That way, we ensure that no new content entity types can be added that do not have functional REST test coverage!
Same for config entity types, of course.
Comment #24
Anonymous (not verified) CreditAttribution: Anonymous commented#23: follow-up issue has been created #2868035: Test that all core content+config entity types have functional REST test coverage.
Comment #25
Wim Leers#24: <3
Comment #26
Wim LeersUpdating issue title & status to reflect the actual status of this issue: this is a plan issue that will be closed once all its children are closed.
25 of the 37 child issues remain yet to be fixed.
Comment #27
Wim LeersThe following landed:
22 remain.
Comment #28
Wim Leers#2843754: EntityResource: Provide comprehensive test coverage for Feed entity landed.
21 remain.
Comment #29
naveenvalecha2 more down. #2843774: EntityResource: Provide comprehensive test coverage for BlockContentType entity and #2843756: EntityResource: Provide comprehensive test coverage for FieldStorageConfig entity landed.
19 remaining
//Naveen
Comment #30
Wim Leers#2843768: EntityResource: Provide comprehensive test coverage for Tour entity actually landed on April 15, we missed that here.
18 remain.
Comment #31
Wim LeersAlso, #2843753: Prevent ContentModerationState from being exposed by REST's EntityResource no longer needs to be done, since #2779931: Add storage exception that enforces unique content_entity_type_id and content_entity_id on the content moderation state content entity, and add access control handler to forbid all access determined it was an "internal" entity type; it makes no sense to access or manipulate these config entities via REST according to the Workflow Initiative contributors.
17 remain.
Comment #32
Wim Leers#2843771: EntityResource: Add an admin permission to RdfMapping entity and provide comprehensive test coverage landed!
16 remain.
Comment #33
Wim Leers#2843767: EntityResource: Provide comprehensive test coverage for BaseFieldOverride entity + add missing access control handler and #2843758: EntityResource: Remove ViewAccessControlHandler and provide comprehensive test coverage for View entity landed!
14 remain.
Comment #34
Wim Leers#2843772: EntityResource: Provide comprehensive test coverage for DateFormat entity and #2843768: EntityResource: Provide comprehensive test coverage for Tour entity landed.
(In #30 I said that #2843768 landed on April 18, but that was not actually true: there was a "this got committed" message by a core committer, but they decided to change their mind before pushing.)
13 remain.
Comment #35
Wim Leers#2843783: EntityResource: Provide comprehensive test coverage for Menu entity landed.
Comment #36
kristiaanvandeneyndeCross-posting from #2843772-33: EntityResource: Provide comprehensive test coverage for DateFormat entity: When writing these tests in the child issues, please do not test for the special behavior of UID 1.
For the time being, you still need to make sure you're not testing with UID 1 (because god mode hax), but aside from that please do not test anything UID 1 related. You can set up a user with UID 2, 1999, 3141592, etc. to run your test with.
Comment #37
Wim Leers#36 is not quite accurate. Rectified in #2843772-34: EntityResource: Provide comprehensive test coverage for DateFormat entity and #2843772-35: EntityResource: Provide comprehensive test coverage for DateFormat entity.
Comment #38
Wim LeersFixing a few bugs in the issue summary.
Comment #39
Wim LeersThe fixes in #38 made me realize only 11 remain.
Comment #40
Wim Leers#2843770: EntityResource: Provide comprehensive test coverage for ResponsiveImageStyle entity landed, 10 remain.
Comment #41
Wim LeersActually, turns out that #2843753: Prevent ContentModerationState from being exposed by REST's EntityResource that is necessary, unlike what #31 said.
Comment #42
Wim Leers#2843785: EntityResource: Provide comprehensive test coverage for Workflow entity landed though!
Comment #43
Wim Leers#2843753: Prevent ContentModerationState from being exposed by REST's EntityResource landed.
Comment #44
Wim LeersAdded #2835767: Media + REST: comprehensive test coverage for Media + MediaType entity types, for both
Media
andMediaType
.Comment #46
Wim Leers#2843778: EntityResource: Provide comprehensive test coverage for ContactForm entity landed!
Comment #47
Wim LeersGiven that #2835767 adds test coverage for two entity types, we're virtually at five entity types remaining! 🎉
Comment #48
Wim Leers#2843776: EntityResource: Provide comprehensive test coverage for EntityTestBundle entity landed.
Comment #49
Wim Leers#2835845: EntityResource: Provide comprehensive test coverage for BlockContent entity landed.
Comment #50
Wim Leers#2835767: Media + REST: comprehensive test coverage for Media + MediaType entity types landed.
Comment #51
Wim LeersI really need to clear up #2867266: Decouple access handlers for entity_view_mode and entity_form_mode from field_ui.module because it's blocking 4 of the 6 remaining issues:
Comment #52
Wim LeersNow that the end is near, let's make sure we don't ever regress: #2868035: Test that all core content+config entity types have functional REST test coverage.
Comment #53
Wim Leers#2843780: EntityResource: Provide comprehensive test coverage for EntityFormMode entity landed!
Comment #54
Wim Leers#2843781: EntityResource: Provide comprehensive test coverage for EntityViewMode entity landed!
Comment #55
Wim LeersThe four remaining ones:
(In the order they will likely be fixed.)
Comment #56
Anonymous (not verified) CreditAttribution: Anonymous commentedThat's cool! 🚀
Comment #57
Wim Leers#2866666: Add proper access handlers for view and form displays landed, which means #2843764: EntityResource: Provide comprehensive test coverage for EntityFormDisplay entity and #2843765: EntityResource: Provide comprehensive test coverage for EntityViewDisplay entity are now RTBC too! We're virtually down to a single remaining issue! 🙃🙃🙃🙃🙃🙃
Comment #58
Wim LeersUhm, why do I only notice now that this has
priority? This is definitely .And it's now against 8.5.
Comment #59
Wim Leers#2843755: EntityResource: Provide comprehensive test coverage for Message entity landed!
The three remaining ones:
(In the order they will likely be fixed.)
Comment #60
Wim LeersForgot to update the IS.
Comment #61
Wim Leers#2843764: EntityResource: Provide comprehensive test coverage for EntityFormDisplay entity and #2843765: EntityResource: Provide comprehensive test coverage for EntityViewDisplay entity landed! Only one remains now: #2843139: EntityResource: Provide comprehensive test coverage for File entity, and tighten access control handler!
EXCITING!!!!!!!!!!!!!
🍾🎉
Comment #62
Wim LeersIn my excitement, I again forgot to update the IS, sorry :P
Comment #63
Wim Leers#2843139: EntityResource: Provide comprehensive test coverage for File entity, and tighten access control handler is RTBC since yesterday. Exciting … we may be able to finally close this one! It's already been more than a year of work, but the end is finally within reach…
Comment #64
Anonymous (not verified) CreditAttribution: Anonymous commentedVictory!
Many thanks, Wim Leers! I help at the novice level, but I also see how Wim Leers day by day as a storm sweeps by a much more complicated issues, and together with other elite drupalers create a story. It's very inspiring!
Comment #65
xjmhttps://twitter.com/xjmdrupal/status/937376064753623040
I think this can be marked fixed now!
Comment #66
Wim Leers#64: ❤️❤️ You've been an enormous help throughout all this though! And it's been inspiring to see your amazing "thank you" messages, such as #2843139-121: EntityResource: Provide comprehensive test coverage for File entity, and tighten access control handler :)
#65: hahah :D
This means #2910883: Move all entity type REST tests to the providing modules is now unblocked!
Comment #67
timmillwoodTalking to Wim last week, it sounds like we'll need these tests for Workspace module, which plans to introduce three new entity types into core. Opened an issue on the contrib branch we working on #2928215: Write EntityResourceTestBase subclasses for workspace, content_workspace, and replication_log entities.
Comment #68
Wim Leers#67 👌
Comment #69
Anonymous (not verified) CreditAttribution: Anonymous commented#65: Wow! I read that Google Translate improved translations based on neural networks. But did not know that so much! Although, maybe just @xjm has the skill to see poetry in prose! Nicely ❤️
#66: Yep I'm lucky with good images (or with good people, who can correctly perceive them). Thanks!
Annd, del last item! 🔥
Comment #70
Wim Leers:D
Comment #71
webchickLet's make sure we brag about this. :D