Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
views.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Oct 2013 at 23:33 UTC
Updated:
29 Jul 2014 at 23:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dawehner.
Comment #2
damiankloip commentedMaybe just 'The mocked module handler'.
s/$the/The - unless you know something I don't about using variables in docs.. ;)
I *think* we put {@inheritdoc} here now?
@see ?
We can use assertCount() here instead.
Do you think we should make these array comparison ones assertSame() ?
assertArrayHasKey() can be used here.
Comment #3
dawehnerThank you for the review!!
Comment #4
dawehner.
Comment #5
tim.plunkettI noticed that the coverage for fetchBaseTables() was incomplete, and realized that the test data was declaring the weight wrong. I decided to expand it to test all paths of the sort.
In addition, I think we've actually proven that the "If the key is invalid, return an empty array." case is unreachable code.
I cannot figure out how to arrive at that line. Either it is populated via cache, or we have
$this->storage[$key] = array();.Yay unit tests leading to removing dead code!
Comment #6
tim.plunkettActually, I meant take that one step further.
Comment #7
dawehnerOh yeah I was worried that I could not test that line.
Comment #8
damiankloip commentedSorry to add another chef to the kitchen here, but I really couldn't be bothered to write this down, easier to just do it. Probably same as Tim above :)
I think we should setup the mock expectations for the cache backend in some of the other test methods, as they cover cases that are not covered below by the warmCache* methods. Like calling get(), then get($table_name), then get($random_table_name).
Oh, and brought back the -50 weight, so the fetchTables gets testing with a lower and higher weight, as well as a lower/higher title. So that should exercise the sorting.
Comment #9
dawehnerGreat improvements!
Comment #10
webchickCommitted and pushed to 8.x. Thanks!