Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There are already a couple of @todos in ViewExectuableTest, Let's implement those and improve the test coverage.
Patch to follow shortly.
Comment | File | Size | Author |
---|---|---|---|
#13 | 1866804-13.patch | 12.08 KB | damiankloip |
#11 | 1866804-11.patch | 12.1 KB | damiankloip |
#11 | interdiff.txt | 1.74 KB | damiankloip |
#9 | 1866804-9.patch | 12.12 KB | damiankloip |
#9 | interdiff.txt | 4.22 KB | damiankloip |
Comments
Comment #1
damiankloip CreditAttribution: damiankloip commentedHere is a patch to kick things off.
Comment #2
damiankloip CreditAttribution: damiankloip commentedConverted the tests to ViewUnitTestBase and added another test (from @todo of last patch) for checking the usesPager() method.
Comment #3
dawehnercool!
As a follow up we might want getUseAjax but sure this is out of scope here.
We could document in the assertion message that the test_executable_displays view has the none pager documented.
What about using random integers?
That's not true, it should be TRUE ;)
Tim patched in another issue to protected
Shouldn't we use format_string instead (not sure).
Comment #4
damiankloip CreditAttribution: damiankloip commentedThanks dawehner!
Do you know which patch? Do you think I should revert this one then? Seems weird in a cleanup of this file thought :)
I'm not sure about exactly when to use the format_string() method. I like going with a normal string as it's one less function call, and every little helps.
Sure, we should create a follow up to add the getUseAJAX method.
Comment #5
damiankloip CreditAttribution: damiankloip commentedRemoved the @todo I todoed already and added the format_string().
Comment #6
damiankloip CreditAttribution: damiankloip commentedSorry, going mad, with the format_string change too.
Comment #7
damiankloip CreditAttribution: damiankloip commentedI created a follow up here for the getter: #1866910: Add an ajaxEnabled() method for ViewExecutable
Comment #8
damiankloip CreditAttribution: damiankloip commentedIt's also worth noting, switching this to use ViewUnitTestBase cut the test time from ~45 secs to ~13 secs. Not bad!
Comment #9
damiankloip CreditAttribution: damiankloip commentedAdded some more tests for initQuery, get/setResponse, generateItemId, getPath, getUrl, get/setTitle methods.
Comment #10
dawehnerGreat work!
any reason to use randomString and not randomName? randomString is a great source for potential random test failures, but yeah actually for paths it shouldn't be different.
Any special reason to use randomString(10) and not randomString()?
Comment #11
damiankloip CreditAttribution: damiankloip commentedYep, makes sense. I have changed those. I think that is the actual calls you meant?
Comment #12
tim.plunkett+1!
Missing trailing comma
Otherwise, looks great!
Comment #13
damiankloip CreditAttribution: damiankloip commentedNice, thanks for the review!
Rerolled against HEAD and added that trailing comma.
Comment #14
tim.plunkettRTBC when green!
Comment #15
damiankloip CreditAttribution: damiankloip commentedI think we are good to go then :)
Comment #16
tim.plunkett#13: 1866804-13.patch queued for re-testing.
Comment #17
webchickYay test coverage!
Committed and pushed to 8.x. Thanks!