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 fromUUIDTestCase
class. - Change all
assertUUID
byassertUuid
. - Pass an array as a first argument for every
setUp
method. - Declare
UUIDTestCase
asabstract
.
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#3 | uuid-tests-improvements-2763727-3.patch | 7.95 KB | BR0kEN |
|
Comments
Comment #2
BR0kENComment #3
BR0kENComment #4
BR0kENComment #6
skwashd CreditAttribution: skwashd at Dave Hall Consulting for Pfizer, Inc. 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.4
into*.info
file?Comment #8
skwashd CreditAttribution: skwashd at Dave Hall Consulting for Pfizer, Inc. commentedI discussed this with Dick Olsson, another one of the comaintainers. We agreed that adding
php = 5.4
could 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 CreditAttribution: skwashd at Dave Hall Consulting for Pfizer, Inc. commentedI've updated the automated testing config for the project. I also requeued the tests that had failed. I think we're good now.