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.
A large majority of the 8.x codebase is now covered by automated testing, and we have been adding extra tests as we discover new places or add new functionality. This issue will track the full test coverage analysis, as there are definitely some areas of code which are not tested.
The equivalent issue for 7.x is #2112869: 7.x test coverage
Comment | File | Size | Author |
---|
Comments
Comment #2
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThe section of the status report provided by Scheduler is not covered by tests. A patch on #2781433: Replace deprecated usage of Drupal::url in .install status report passed when manual testing showed several faults in the code. This new test file checks some text and verifies the accuracy of the hrefs in the two links provided.
Comment #4
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedI have now written tests to cover all of the actions, conditions and events we provide for interaction with Rules. However, until #2775519: Automated testing for 3rd-party modules integrating with Rules is resolved I cannot commit them to our codebase.
Comment #5
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedI committed the three Rules Integration Test files.
Comment #6
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedI have added a small test to the Revisioning file to test the 'touch' option (alter created date to match publish_on date). Also in this patch is some tidy up:
$this->nodeStorage
instead of defining$node_storage
REQUEST_TIME
as second parameter tostrtotime()
calls so that the result is consistent throughout the testt( )
which should not be used in automated simpletests. Useprintf()
instead where parameter values are neededAdding the test for the 'touch' option in 8.x is a pre-requisite to adding it in 7.x, which I want to do as part of my testing of the Drupal Coverage Coremodule on the DCC test site.
Comment #8
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedCommitted, so now I can do the same on #2112869-13: 7.x test coverage
Comment #9
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedWe now have a test file for the admin settings page - added in #2831429: Date format placeholders not replaced in error message
Comment #10
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedI have divided the 'node delete' test into two functions.
Comment #12
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThe SchedulerBasicTest needs a few changes:
database->update
calls (which are not a good thing to do) by setting the$node->$key
value then using$node->save()
Comment #14
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThe SchedulerDefaultTimeTest needs a few changes:
date()
and use\Drupal::service('date.formatter')
insteadassertDefaultTime()
and put the code into the main test function$this->assertText
with$this->assertSession()->pageTextContains
$this->assertNoText
with$this->assertSession()->pageTextNotContains
Comment #18
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThe above commit splits
testRulesEvents()
into three separate test functionstestRulesEventsNone()
when no scheduler dates exist in the node,testRulesEventsPublish()
for testing the publish events when the node has publish date andtestRulesEventsUnpublish()
for the unpublish events. This is so that if one part fails we still get good info on the other parts. Or if something major is wrong then we get three test failures.Comment #20
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThe commit in #19 expands the tests to cover setting the Scheduler dates via Rules actions when creating a new node, not just when editing an existing node.
Comment #21
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commented