Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
field system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
30 Nov 2014 at 23:24 UTC
Updated:
25 Dec 2014 at 16:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
penyaskitoPatch attached.
Comment #2
benjy commentedGood catch.
Comment #3
alexpottLet's test this in FieldConfigEntityUnitTest
Comment #4
benjy commentedI first went with the following on top of the class:
But I decided that catching the exception would allow me to assert the exact error message since we had previously got that wrong as well.
Comment #5
penyaskitoIf message is hardcoded, why the previous approach would not work?
Comment #6
benjy commentedGood point, when I wrote that I was using $this->entityTypeId which is calculated at run time but then I updated it last minute. New patch attached.
Thanks for the review.
Comment #7
penyaskitoI was just curious, not a strong preference. Both #4 and #6 look good to me.
Comment #8
dawehnerDo we really want to ensure that things are called here in that exact order? I think using ->willReturnValueMap is the better approach to reduce changes in the test, when the actual code is refactored.
Comment #9
benjy commentedIt was an exact copy and paste from the test above it. We could refactor both tests if you think willReturnValueMap() is better, how about a follow-up for that?
Comment #10
dawehnerOkay sure, where is the URL :P
Comment #11
benjy commentedIssue created, #2389837: Refactor FieldConfigEntityUnitTest to make it resilient to changes. See you there.
Comment #12
penyaskitoPostponed that one on this one.
Comment #13
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 1ffac67 and pushed to 8.0.x. Thanks!