When running the Acquia Agent tests, I am receiving a fatal error: Call to undefined function _acquia_agent_authenticator(). The reason is that I do not have the Acquia Agent module installed when running the tests, therefore the unit tests don't have access to the _acquia_agent_authenticator() function. This will likely be an issue with the test bot on D.O. According the to the DrupalUnitTestCase::setUp() docblocks:

Unlike DrupalWebTestCase::setUp(), DrupalUnitTestCase::setUp() does not install modules because tests are performed without accessing the database. Any required files must be explicitly included by the child class setUp() method.

Therefore we should explicitly require the acquia_agent.module file in the overridden setUp() method so tests can be run without having to install the module on the testing environment.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cpliakas’s picture

Status: Active » Needs review
FileSize
648 bytes

Attached patch adds the fix.

coltrane’s picture

Causes the unit test to fail with "The test cannot be executed because it has not been set up properly."

Need to invoke parent::setUp()

cpliakas’s picture

Status: Needs review » Reviewed & tested by the community

Well that was pretty stupid on my part. Patch in #2 fixes the issue.

coltrane’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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