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

  1. Remove the setUp method from UUIDTestCase class.
  2. Change all assertUUID by assertUuid.
  3. Pass an array as a first argument for every setUp method.
  4. Declare UUIDTestCase as abstract.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

BR0kEN created an issue. See original summary.

BR0kEN’s picture

Issue summary: View changes
BR0kEN’s picture

BR0kEN’s picture

Status: Active » Needs review

  • skwashd committed d632ce4 on 7.x-1.x authored by BR0kEN
    Issue #2763727 by BR0kEN: Optimizations and fixes for tests
    
skwashd’s picture

Status: Needs review » Fixed

Thanks 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.

BR0kEN’s picture

UUID 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?

skwashd’s picture

I 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.

BR0kEN’s picture

Trait 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).

skwashd’s picture

I've updated the automated testing config for the project. I also requeued the tests that had failed. I think we're good now.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.