Download & Extend

Write Unit tests for the Updater classes

Project:Drupal core
Version:7.x-dev
Component:update system
Category:task
Priority:normal
Assigned:chx
Status:active
Issue tags:Update manager

Issue Summary

The Updater classes could probably be tested to some degree. I don't know how useful they would be to unit test because they rely so heavily on the Drupal stack, but it is the closest thing to a testable piece of the Plugin Manager we've got, and at least exersizing the code in the template pattern could be useful.

Exercising the code by providing a Mock implementation will allow us to at least simulate an install and read out the expected operations and the directories they would affect.

Comments

#1

This should be a lot easier to test now that we have a FileTransferLocal class from #609728: Skip authorize.php step if webroot files are owned by the httpd user

#2

We actually had a FileTransferTest class and unit tests I wrote in part 1, but due to a PHP bug and lack of interest, they never got finalized in core AFAIK.
#395472: Plugin Manager in Core: Part 1 (backend)

modules/simpletest/tests/filetransfer.test

If I was to write a unit test for this, I'd write one for the Updaters in a similar fashion.

We could do actual file transfers too, but mocking might be easier to validate.

#3

Assigned to:Anonymous» chx