Closed (fixed)
Project:
Drupal core
Version:
8.5.x-dev
Component:
hal.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Oct 2017 at 14:12 UTC
Updated:
7 Nov 2017 at 16:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
wim leersThis patch is basically #2864816-12: HAL LinkManager doesn't add 'url.site' cache context when needed + #2864816-23: HAL LinkManager doesn't add 'url.site' cache context when needed.
Comment #3
wim leersAs of #2864816-26: HAL LinkManager doesn't add 'url.site' cache context when needed, this blocks that issue.
Comment #5
wim leersOops, this hunk is only for #2864816: HAL LinkManager doesn't add 'url.site' cache context when needed. Removing that.
Comment #6
dawehnerThis looks great for me! We could try to share code between the two providers, but I actually believe that DRY for tests is totally overstated.
Comment #7
xjmI was disappointed to find this site does not actually exist. Quick, grab the domain! :P
Comment #8
wim leers🤣
Comment #9
catchDon't these need phpdoc? If they don't is that in coding standards somewhere?
Comment #10
dawehnerThere are glorious examples like:
over
to
I always assumed the only standard was just some kind of naming scheme.
Comment #11
wim leersThis.
Honestly, PHPUnit's data provider mechanism already imposes/requires sufficient structure, that adding additional comments for them just is a waste of time.
Comment #12
alexpottI agree with @Wim Leers and @dawehner - the most important thing in the data provider is the text in the array keys - makes it so much easier to work out what's going on.
I do think that
We're going to have a problem when we turn on the rule for @param documentation. I think it might be worth considering coding standards for tests. In some ways it is tempting to say it should be just the same as for regular code. So we don't have to maintain multiple rulesets. I dunno.
I've pinged @catch for more opinion.
Comment #13
wim leersIt'd be great if we could exempt PHPUnit data providers from that rule. I'm not sure if that's possible though. The exemption would look like this:
That'd remove a nice chunk of annoying boilerplate!
Comment #15
alexpott@Wim Leers - good idea I'll propose a coding standards change in their issue queue.
Comment #16
alexpottCreated #2918440: Define a standard for documenting data providers in PHPUnit-based tests.
Discussed with @catch and he said:
Comment #17
alexpottCommitted and pushed ff6381f7cf to 8.5.x and 94f54936f6 to 8.4.x. Thanks!
Backported to 8.4,x because it is a test only change.
Comment #20
wim leers👍 — left a comment at #2918440-2: Define a standard for documenting data providers in PHPUnit-based tests.
This also unblocked #2864816 — see #2864816-28: HAL LinkManager doesn't add 'url.site' cache context when needed!