Closed (fixed)
Project:
Drupal core
Version:
9.2.x-dev
Component:
migration system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Feb 2021 at 07:40 UTC
Updated:
8 Oct 2021 at 17:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
quietone commentedComment #5
quietone commentedI have followed the iinstructions for Rebasing a merge request and am not able to push changes. So I give up.
Here is a patch.
Comment #6
quietone commentedTagging for Drupal South. Good for someone who knows or whats to learn about using a dataprovider for a test. The test is there, this is just converting it to use a dataprovider.
Comment #7
quietone commentedUse the right tag!
Comment #8
kristen polThanks for the patch. Here's some feedback (mostly nitpicks):
Nitpick: Add quotes around
node_type?Nitpick: Include class to avoid backslash to be consistent with
InvalidPluginDefinitionException.Nitpick: Add quotes around
user?Same as above.
Nitpick: Add quotes around
fooandnode?Nitpick: Since the function is called
prepareand there is no longer asetUpfunction, consider rewording.Note: Looking through other code, didn't find any other protected function called
prepareexcept inHtmlRendererbut the otherpreparefunctions were not used for tests. The only other test-relatedpreparefunction I saw was inMultilingualReviewPageTestBasewhich is public. But, since this is for internal processing,protectedseems okay.Nitpick: Add an empty line above comment.
Nitpick: Could use a better comment.
Nitpick: Consider adding a comment.
Unclear where
$this->anonis being used.Nitpick: Consider adding a comment.
Nitpick: Consider adding a comment.
Comment #9
quietone commented@Kristen Pol, thank you for the review.
I think that these are out of scope, beyond what is needed to rearrange the test to use a data provider.
1, 3, 5: These would require changes to ContentEntity.
2, 4: \InvalidArgumentException is the class.
7. Haha, it seems I like to use 'prepare'
11. True. This was added in #3187318: ContentEntity source plugin should exclude user with uid "0" and I think that if we want to add a comment it should be as a follow up to that.
What I have modified are:
6. Changed the comment.
8, 9, 10, 12, 13 I think these are out of scope but have added them because adding comments is usually a good idea and I don't think this conflicts with any other issue. There is one larger comment and the beginning of the block adding this 'extra' data.
Done
9. This is also out of scope
Comment #10
longwaveWould it be cleaner to break the constructor test out into its own test class, and move
prepare()back tosetUp()? The constructor test is testing different things to the other test methods.Comment #11
quietone commented@longwave, I thought about that but as we see I didn't. Since you suggested I have done so.
This patch moves the constructor tests to a new file. To stay within scope it does not make the changes to the comments suggested in #8. That can be done in another issue.
There is no interdiff because this is a new approach.
Comment #12
longwaveThis makes the conversion simple and straightforward now.
Comment #13
quietone commentedThe changes to the comments suggested in #8 are now in #3229734: Improve test and add comments to ContentEntityTest
Comment #14
alexpottCommitted and pushed c14450bc96 to 9.3.x and d6ead31b37 to 9.2.x. Thanks!
Backported to 9.2.x because this is about tests only.