Problem/Motivation
Currently the setUp method in UUIDTestCase class is redundant and should not be exist because it have no logic which could be used by any child class.
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp(func_get_args());
}
The code above passes an array of module names to a parent class. The setUp of the DrupalWebTestCase class can take an array of modules as a first argument or a list of argument where every single one is a module name.
Also, previous changes affected name of the assertUUID method in UUIDTestCase class - method have been renamed to assertUuid but its invocations have not been changed (we have the assertUuid method but invoke the assertUUID).
The UUIDTestCase class have no testing methods and should be declared as abstract.
Proposed resolution
- Remove the
setUp method from UUIDTestCase class.
- Change all
assertUUID by assertUuid.
- Pass an array as a first argument for every
setUp method.
- Declare
UUIDTestCase as abstract.
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
None.
Comments
Comment #2
br0kenComment #3
br0kenComment #4
br0kenComment #6
skwashd commentedThanks for the patch. I realised some time after pushing the change that I should've fixed the capitalisation of the calls. I realised today that we can use a trait for this function. I've committed that change too.
Comment #7
br0kenUUID module has no requirements regarding PHP version and traits support has been added since 5.4. Do you want add
php = 5.4into*.infofile?Comment #8
skwashd commentedI discussed this with Dick Olsson, another one of the comaintainers. We agreed that adding
php = 5.4could break sites for users stuck on Ubuntu 12.04LTS and other distros using PHP 5.3. The trait is only used in the tests. We feel that this is a reasonable compromise.Comment #9
br0kenTrait usage already caused PHP parsing error in #2763369: Populate information about DB index to Schema API thread. I have created another thread to discuss this (#2763943: Prevent running the tests on environments with PHP lower than 5.4).
Comment #10
skwashd commentedI've updated the automated testing config for the project. I also requeued the tests that had failed. I think we're good now.