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 and Vocabulary.
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
  1. MenuLinkContent: #2832859: Write EntityResourceTestBase subclasses for: MenuLinkContent Assigned to: webflo
  2. BlockContent: #2835845: EntityResource: Provide comprehensive test coverage for BlockContent entity
  3. File: #2843139: EntityResource: Provide comprehensive test coverage for File entity, and tighten access control handler
  4. Shortcut: #2843750: EntityResource: Provide comprehensive test coverage for Shortcut entity
  5. Item: #2843752: EntityResource: Provide comprehensive test coverage for Item entity Assigned to: shadcn
  6. ContentModerationState: #2843753: Prevent ContentModerationState from being exposed by REST's EntityResource
  7. Feed: #2843754: EntityResource: Provide comprehensive test coverage for Feed entity Assigned to: rogierbom
  8. Message: #2843755: EntityResource: Provide comprehensive test coverage for Message entity
  9. Media: #2835767: Media + REST: comprehensive test coverage for Media + MediaType entity types
Config entity types
  1. FieldStorageConfig: #2843756: EntityResource: Provide comprehensive test coverage for FieldStorageConfig entity Assigned to: jamesdeee
  2. FilterFormat: #2843757: EntityResource: Provide comprehensive test coverage for FilterFormat entity
  3. View: #2843758: EntityResource: Remove ViewAccessControlHandler and provide comprehensive test coverage for View entity Assigned to: jamesdeee
  4. SearchPage: #2843759: EntityResource: Provide comprehensive test coverage for SearchPage entity
  5. ConfigurableLanguage: #2843761: EntityResource: Provide comprehensive test coverage for ConfigurableLanguage entity
  6. Action: #2843762: EntityResource: Provide comprehensive test coverage for Action entity
  7. ContentLanguageSettings: #2843763: EntityResource: Provide comprehensive test coverage for ContentLanguageSettings entity Assigned to: shadcn
  8. EntityFormDisplay: #2843764: EntityResource: Provide comprehensive test coverage for EntityFormDisplay entity
  9. EntityViewDisplay: #2843765: EntityResource: Provide comprehensive test coverage for EntityViewDisplay entity
  10. FieldConfig: #2843766: EntityResource: Provide comprehensive test coverage for FieldConfig entity
  11. BaseFieldOverride: #2843767: EntityResource: Provide comprehensive test coverage for BaseFieldOverride entity + add missing access control handler Assigned to: shadcn
  12. Tour: #2843768: EntityResource: Provide comprehensive test coverage for Tour entity
  13. ResponsiveImageStyle: #2843770: EntityResource: Provide comprehensive test coverage for ResponsiveImageStyle entity
  14. RdfMapping: #2843771: EntityResource: Add an admin permission to RdfMapping entity and provide comprehensive test coverage
  15. DateFormat: #2843772: EntityResource: Provide comprehensive test coverage for DateFormat entity
  16. RestResourceConfig: #2843773: EntityResource: Provide comprehensive test coverage for RestResourceConfig entity Assigned to: Wim Leers
  17. BlockContentType: #2843774: EntityResource: Provide comprehensive test coverage for BlockContentType entity Assigned to: jamesdeee
  18. CommentType: #2843775: EntityResource: Provide comprehensive test coverage for CommentType entity Assigned to: shadcn
  19. EntityTestBundle: #2843776: EntityResource: Provide comprehensive test coverage for EntityTestBundle entity
  20. NodeType: #2843777: EntityResource: Provide comprehensive test coverage for NodeType entity Assigned to: shadcn
  21. ContactForm: #2843778: EntityResource: Provide comprehensive test coverage for ContactForm entity
  22. ShortcutSet: #2843779: EntityResource: Provide comprehensive test coverage for ShortcutSet entity
  23. EntityFormMode: #2843780: EntityResource: Provide comprehensive test coverage for EntityFormMode entity
  24. EntityViewMode: #2843781: EntityResource: Provide comprehensive test coverage for EntityViewMode entity
  25. Editor: #2843782: EntityResource: Provide comprehensive test coverage for Editor entity Assigned to: shadcn
  26. Menu: #2843783: EntityResource: Provide comprehensive test coverage for Menu entity
  27. ModerationStateTransition: #2843784: EntityResource: Provide comprehensive test coverage for ModerationStateTransition entity
  28. Workflow: #2843785: EntityResource: Provide comprehensive test coverage for Workflow entity
  29. ImageStyle: #2843786: EntityResource: Provide comprehensive test coverage for ImageStyle entity
  30. MediaType: #2835767: Media + REST: comprehensive test coverage for Media + MediaType entity types

Comments

Wim Leers created an issue. See original summary.

Wim Leers’s picture

Title: [PP-1] Write EntityResourceTestBase subclasses for every other entity type. » Write EntityResourceTestBase subclasses for every other entity type.
Category: Task » Plan
Status: Postponed » Active
Issue tags: +Novice, +php-novice

This 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.

harings_rob’s picture

Added 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

Wim Leers’s picture

Issue summary: View changes

Thanks! This is perfect :)

Wim Leers’s picture

vijaycs85’s picture

Issue summary: View changes
naveenvalecha’s picture

Issue summary: View changes
naveenvalecha’s picture

Issue summary: View changes

Created child issues for every entity.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Wim Leers’s picture

Priority: Major » Normal
Wim Leers’s picture

Wim Leers’s picture

naveenvalecha’s picture

Wim Leers’s picture

naveenvalecha’s picture

Wim Leers’s picture

Wim Leers’s picture

timmillwood’s picture

Ticked two off the list.

timmillwood’s picture

Re-opened #2843785: EntityResource: Provide comprehensive test coverage for Workflow entity and converted it to workflow entity, which replaced moderation_state and moderation_state_transition.

Wim Leers’s picture

Still, yay, one less issue to deal with! :)

Wim Leers’s picture

Once 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.

Anonymous’s picture

Wim Leers’s picture

#24: <3

Wim Leers’s picture

Title: Write EntityResourceTestBase subclasses for every other entity type. » [PP-25] Write EntityResourceTestBase subclasses for every other entity type.
Status: Active » Postponed

Updating 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.

Wim Leers’s picture

Title: [PP-25] Write EntityResourceTestBase subclasses for every other entity type. » [PP-22] Write EntityResourceTestBase subclasses for every other entity type.
Issue summary: View changes
Wim Leers’s picture

Title: [PP-22] Write EntityResourceTestBase subclasses for every other entity type. » [PP-21] Write EntityResourceTestBase subclasses for every other entity type.
Issue summary: View changes
naveenvalecha’s picture

Title: [PP-21] Write EntityResourceTestBase subclasses for every other entity type. » [PP-19] Write EntityResourceTestBase subclasses for every other entity type.
Issue summary: View changes
Wim Leers’s picture

Title: [PP-19] Write EntityResourceTestBase subclasses for every other entity type. » [PP-18] Write EntityResourceTestBase subclasses for every other entity type.
Issue summary: View changes

#2843768: EntityResource: Provide comprehensive test coverage for Tour entity actually landed on April 15, we missed that here.

18 remain.

Wim Leers’s picture

Title: [PP-18] Write EntityResourceTestBase subclasses for every other entity type. » [PP-17] Write EntityResourceTestBase subclasses for every other entity type.
Issue summary: View changes

Also, #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.

Wim Leers’s picture

Title: [PP-17] Write EntityResourceTestBase subclasses for every other entity type. » [PP-16] Write EntityResourceTestBase subclasses for every other entity type.
Wim Leers’s picture

Title: [PP-16] Write EntityResourceTestBase subclasses for every other entity type. » [PP-14] Write EntityResourceTestBase subclasses for every other entity type.
Issue summary: View changes
Wim Leers’s picture

Title: [PP-14] Write EntityResourceTestBase subclasses for every other entity type. » [PP-13] Write EntityResourceTestBase subclasses for every other entity type.
Issue summary: View changes

#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.

Wim Leers’s picture

Title: [PP-13] Write EntityResourceTestBase subclasses for every other entity type. » [PP-12] Write EntityResourceTestBase subclasses for every other entity type.
Issue summary: View changes
kristiaanvandeneynde’s picture

Cross-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.

Wim Leers’s picture

Wim Leers’s picture

Issue summary: View changes

Fixing a few bugs in the issue summary.

Wim Leers’s picture

Title: [PP-12] Write EntityResourceTestBase subclasses for every other entity type. » [PP-11] Write EntityResourceTestBase subclasses for every other entity type.

The fixes in #38 made me realize only 11 remain.

Wim Leers’s picture

Title: [PP-11] Write EntityResourceTestBase subclasses for every other entity type. » [PP-10] Write EntityResourceTestBase subclasses for every other entity type.
Issue summary: View changes
Wim Leers’s picture

Title: [PP-10] Write EntityResourceTestBase subclasses for every other entity type. » [PP-11] Write EntityResourceTestBase subclasses for every other entity type.

Actually, turns out that #2843753: Prevent ContentModerationState from being exposed by REST's EntityResource that is necessary, unlike what #31 said.

Wim Leers’s picture

Title: [PP-11] Write EntityResourceTestBase subclasses for every other entity type. » [PP-10] Write EntityResourceTestBase subclasses for every other entity type.
Issue summary: View changes
Wim Leers’s picture

Title: [PP-10] Write EntityResourceTestBase subclasses for every other entity type. » [PP-9] Write EntityResourceTestBase subclasses for every other entity type.
Issue summary: View changes
Wim Leers’s picture

Title: [PP-9] Write EntityResourceTestBase subclasses for every other entity type. » [PP-11] Write EntityResourceTestBase subclasses for every other entity type.
Issue summary: View changes

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Wim Leers’s picture

Title: [PP-11] Write EntityResourceTestBase subclasses for every other entity type. » [PP-10] Write EntityResourceTestBase subclasses for every other entity type.
Issue summary: View changes
Wim Leers’s picture

  1. #2843776: EntityResource: Provide comprehensive test coverage for EntityTestBundle entity has been RTBC for about a week now.
  2. #2835845: EntityResource: Provide comprehensive test coverage for BlockContent entity is RTBC as of this morning.
  3. #2835767: Media + REST: comprehensive test coverage for Media + MediaType entity types has a sole blocker remaining (and that blocker is RTBC), then this will become able to RTBC again.
  4. #2843755: EntityResource: Provide comprehensive test coverage for Message entity has a reviewable, RTBC'able patch as of a few minutes ago.

Given that #2835767 adds test coverage for two entity types, we're virtually at five entity types remaining! 🎉

Wim Leers’s picture

Title: [PP-10] Write EntityResourceTestBase subclasses for every other entity type. » [PP-9] Write EntityResourceTestBase subclasses for every other entity type.
Issue summary: View changes
Wim Leers’s picture

Title: [PP-9] Write EntityResourceTestBase subclasses for every other entity type. » [PP-8] Write EntityResourceTestBase subclasses for every other entity type.
Issue summary: View changes
Wim Leers’s picture

Title: [PP-8] Write EntityResourceTestBase subclasses for every other entity type. » [PP-6] Write EntityResourceTestBase subclasses for every other entity type.
Issue summary: View changes
Wim Leers’s picture

Wim Leers’s picture

Title: [PP-6] Write EntityResourceTestBase subclasses for every other entity type. » [PP-5] Write EntityResourceTestBase subclasses for every other entity type.
Issue summary: View changes
Wim Leers’s picture

Title: [PP-5] Write EntityResourceTestBase subclasses for every other entity type. » [PP-4] Write EntityResourceTestBase subclasses for every other entity type.
Issue summary: View changes
Anonymous’s picture

That's cool! 🚀

Wim Leers’s picture

Wim Leers’s picture

Version: 8.4.x-dev » 8.5.x-dev
Priority: Normal » Major

Uhm, why do I only notice now that this has Normal priority? This is definitely Major.

And it's now against 8.5.

Wim Leers’s picture

Wim Leers’s picture

Issue summary: View changes

Forgot to update the IS.

Wim Leers’s picture

Title: [PP-3] Write EntityResourceTestBase subclasses for every other entity type. » [PP-1] Write EntityResourceTestBase subclasses for every other entity type.
Wim Leers’s picture

Issue summary: View changes

In my excitement, I again forgot to update the IS, sorry :P

Wim Leers’s picture

#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…

Anonymous’s picture

Status: Postponed » Reviewed & tested by the community

Victory!

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!

xjm’s picture

Status: Reviewed & tested by the community » Fixed

https://twitter.com/xjmdrupal/status/937376064753623040

I think this can be marked fixed now!

Wim Leers’s picture

Title: [PP-1] Write EntityResourceTestBase subclasses for every other entity type. » Write EntityResourceTestBase subclasses for every other entity type.

#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!

timmillwood’s picture

Talking 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.

Wim Leers’s picture

#67 👌

Anonymous’s picture

Issue summary: View changes

#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! 🔥
Wim Leers’s picture

Annd, del last item! 🔥

:D

webchick’s picture

Issue tags: +8.5.0 highlights

Let's make sure we brag about this. :D

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.