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.
As views provides some default views they should be tested as well.
You should probably create some nodes/comments/terms etc. and just see whether the page results what you expected to do.
Below is a list of the views provided by default. The pattern is View -> displays:
Archive -> Block, Page
Backlinks -> Block, Page
Recent comments -> Block, Page #1758486: Write tests for the recent comments view.
Front page -> Feed, Page
Glossary -> Page
Taxonomy Term -> Feed, Page
Tracker -> Page
Comment | File | Size | Author |
---|---|---|---|
#26 | views-17542862-26.patch | 13.16 KB | dawehner |
#25 | views-17542862-25.patch | 8.25 KB | dawehner |
#24 | views-17542862-24.patch | 8.25 KB | dawehner |
#21 | views-1754286-21.patch | 13.24 KB | dawehner |
#21 | interdiff.txt | 7.8 KB | dawehner |
Comments
Comment #1
slv_ CreditAttribution: slv_ commentedI may start with this today. How's the usual approach. 1 Issue per view and keep this post with an updated list, or everything within the same patch here?
Comment #2
dawehnerIn general i don't care, take the approach which is easier for you.
It might be easier to review to have on issue per testCase.
Comment #3
slv_ CreditAttribution: slv_ commentedHaven't done much of testing so far, so will take the issue per view then, so I can have some feedback quicker. Below is a list of the views provided by default, in case you want to update the Issue Summary. The pattern is View -> displays:
Archive -> Block, Page
Backlinks -> Block, Page
Recent comments -> Block, Page
Front page -> Feed, Page
Glossary -> Page
Taxonomy Term -> Feed, Page
Tracker -> Page
Comment #4
xjm@slv_: You can update the issue summary too. :)
Comment #5
slv_ CreditAttribution: slv_ commentedCool, thanks!
Comment #5.0
slv_ CreditAttribution: slv_ commentedAdded a list of the views provided by default
Comment #6
damiankloip CreditAttribution: damiankloip commentedhaving a look at this now.
Comment #7
damiankloip CreditAttribution: damiankloip commentedHere is what I have so far. It checks each default view display can be executed ok and has results in $view->result. The only thing that isn't working currently is the backlinks results. I haven't quite got this working yet.
I think it may also show some warnings to do with the viewExecutable patch that went in.
Comment #8
tim.plunkettComment #10
dawehnerYou need to create a $view = new ViewExecutable($view); first
Comment #11
damiankloip CreditAttribution: damiankloip commentedThis will still fail, but will show the proper failures I think. We need the fixes for the bugs this test uncovers in IndexTidDepth.php and CreatedYearMonth.php. Here are some fixes for those too. Now the backlinks tests should fail.
EDIT: @tim.plunkett: I know you also had another fix for IndexTidDepth. I can't remember exactly what you did so leaving it out for now!
Comment #13
tim.plunkettThat was my only fix for that handler specifically, the other thing was adding views_query_substitutions to hook_hook_info
Comment #14
dawehnerYou set the wrong path.
Now everything links back to node/1
Comment #16
dawehnerAdded block as module to the test.
Comment #17
damiankloip CreditAttribution: damiankloip commentedComment #18
damiankloip CreditAttribution: damiankloip commentedNow dawehner fixed the last part of the tests, I think this one is good to go. I can't RTBC my own patches thought really :)
Comment #19
dawehner#16: views-1754286-16.patch queued for re-testing.
Comment #21
dawehnerSome fixes were needed to get this running, see interdiff.
Comment #22
dawehner...
Comment #23
tim.plunkettShould be \stdClass(), here and elsewhere
Missing trailing commas
Comment #24
dawehnerThanks for the review! Here are the fixes for your comments
Comment #25
dawehnerLOL, forgot to add the actual tests.
Comment #26
dawehnerOh boy.
Comment #27
damiankloip CreditAttribution: damiankloip commentedComment #28
dawehnerCommitted and pushed
Comment #29
tim.plunketthttp://qa.drupal.org/pifr/test/273938
Comment #30
tim.plunkettAh, only the tests were committed, not the fixes.
http://drupalcode.org/project/views.git/commit/7a8919d
Comment #31.0
(not verified) CreditAttribution: commentedadding a link to an existing issue