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.
Problem/Motivation
At one point when Karen S. refactored tests she reduced the amount of code duplication happening there by creating a base date testcase. There are some really old tests that were not refactored to take advantage of this, though: the basic tests happening in date.test still use its own separate createField() method unnecessarily.
Proposed resolution
Refactor the the test in date.test to use DateFieldBasic, making somewhat easier to maintain the tests in the future.
Also use a loop for most of the testing in testFieldUI(), to make code more concise.
Comment | File | Size | Author |
---|---|---|---|
#3 | date-refactored-to-use-datefieldbasic-2198807-3-D7.patch | 9.33 KB | wwedding |
Comments
Comment #1
wwedding CreditAttribution: wwedding commentedI have a patch on the way, I was writing up some tests to catch some reported issues and thought a little cleaning up would be nice, too.
Comment #2
wwedding CreditAttribution: wwedding commentedI almost feel like the test in date.test should be in date_field.test, but here's a patch that just refactors date.test.
Comment #3
wwedding CreditAttribution: wwedding commentedFormatting issues in the first patch.
Comment #4
vijaycs85great cleanup @stickywes. Nothing to complain, just few mentions out of manual review. It is good to go.
I see this is now part of DateFieldBasic::setup()
Nice, cleanup and can see all 9 of them covered with 3x3 foreach
Nice cleanup.
Comment #5
podarok#3 commited
Thanks!
Comment #7
vijaycs85yay! thanks.