Closed (fixed)
Project:
Drupal core
Version:
8.6.x-dev
Component:
statistics.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 Nov 2017 at 15:35 UTC
Updated:
5 Jun 2018 at 09:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jofitzCast the inputs to StatisticsViewsResult to integer in the constructor.
Comment #3
timmillwoodWorks for me.
Comment #4
xjmThanks! It's updating one assertion, but can we also add an explicit test that we always get integer output even when the input is strings?
Comment #5
jofitz@xjm Can you explain a little more, please? I'm sorry, I don't understand what you are asking for.
Comment #7
wim leers@xjm means: construct a
StatisticsViewsResultobject, pass 3 strings, verify you get back 3 integers when you use the 3 getters.My inclination is that that seems a disproportionate amount of testing for the bugfix. OTOH, this appears to not be a problem in core, only with migrate? Then isn't this a bug in migrate?
Comment #8
heddnRe #7: it isn't so much a bug in migrate as a bug in the statistics API that migrate is using in a test. Back to NW for #4.
Comment #9
heddnThis will also need a re-roll if/when #2930101: i18n / statistics - node counter not updated for translations lands. Since it is critical, let's soft-block here. Or get this in super fast. Here's a patch with the added tests.
Comment #11
heddnComment #12
timmillwoodLGTM
Comment #13
alexpottint|string right? as that's the point of the test to assert that if strings are input then ints are output.
Also I think this test would be better as a data provider rather than a single test.
This param is not passed.
Comment #14
jofitzAddressed both of @alexpott's comments in #13.
I'm not sure if there's any point in retaining assertNodeCounter(), but I've left it for now.
Comment #15
borisson_Should be only one empty line
I don't think assertNodeCounter is needed as it's used only once.
Comment #16
dinesh18 commentedremoved the extra empty line as per comment #15.
Here is the patch and interdiff.
Comment #17
dawehnerWhat about providing also the expected values?
Comment #18
jofitzWhat do you mean, @dawehner?
Comment #19
borisson_I'm not sure about adding
assertNodeCounteras a seperate method, it doesn't add any value to extract this, as it's only used in one place. I already mentioned this in #15. If we do that, I feel like @dawehner's remark will be resolved as well.Comment #20
jofitzComment #21
borisson_Awesome, looks great!
Comment #23
MixologicTestbot Snafu.
Comment #25
bibliophileaxeTestbot issue.
Comment #26
alexpottCommitted and pushed c01bed2b2d to 8.6.x and c71f50f5ad to 8.5.x. Thanks!