Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
hal.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Nov 2013 at 07:04 UTC
Updated:
29 Jul 2014 at 23:07 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
larowlanActually, we have the entity manager, lets use it instead of entity_create.
Comment #3
larowlanNeeded to set the entityManager on the normalizer in the tests.
Comment #4
berdirRelated: #1867228: Make EntityTypeManager provide an entity factory and #1892320: Add deserialize for JSON/AJAX
Comment #5
damiankloip commentedYes, patch berdir mentions above already does this approach, so it's good they are aligned.
Comment #6
linclark commentedI'm not sure I understand correctly. What about DenormalizeTest?
Comment #7
damiankloip commentedThat's what I was thinking! :)
Comment #8
larowlanWhoops, how'd I miss that!
Comment #9
berdir3: entity-normalizer.patch queued for re-testing.
Comment #11
damiankloip commentedLet's start this again. The above patch does not apply anymore, but pretty much none of it is the same anymore, since we now inject the deps into these services. Also making the change to inject module handler while we are changing the constructors..
Let's get this ok again, then maybe add a test case for this.
Comment #12
berdirLooks good.
A test could be done by adding a test using terms similar to NodeTest? that explodes right now if you try to denormalize it.
maybe also unset the type from $data then, to avoid setting it twice, similar to the langcode in the ConfigField issue?
Comment #13
damiankloip commentedI have added the unset for the bundle in $data, that makes alot of sense :)
Do we need to add an additional test for this, the fact that we have made these changes to handle the bundle name generically and our current tests work cover this?
Comment #14
berdirI think we do, given the amount of broken things in hal, I wouldn't be surprised if more about terms is broken :)
That said, I'm adding tests for normalizing nodes and terms and back in #2219795: Config entity references broken and other bugs, do we want to merge the patches maybe? There's also @yched's issue about simplfying the field normalizer classes further than I did referenced there, we could merge that in too. Would make it easy to get that stuff in with proper test coverage, although the patches are getting bigger...
Comment #15
berdirOk, the latest patch is now in #2219795: Config entity references broken and other bugs, which made that pass :)