Task #80144
closed
Let child classes of functional tests tinker with the testExtensionsToLoad
Added by Anja Leichsenring over 7 years ago.
Updated almost 7 years ago.
Description
Some of the functional test classes override the array $testExtensionsToLoad with an own value, positively blocking the addition of other extensions.
This might make sense in order to ensure an explicit testing setup for this extension exclusively. On the other hand it prevents the detection of side effects to other extensions.
During this writing, there is no difference, because the functional testing framework lacks the API to register test extensions globally, in order to include them into all tests.
In preparation of the feature 'add global test extensions to functional testing framework', the explicit declaration of $testExtensionsToLoad is moved to the setUp() function. So it is possible to extend the class again and reuse the tests for a global run with combined globally and locally registered test extensions.
Usage example:
class ATest extends FunctionalTestCase {
protected function setUp() {
$this->testExtensionsToLoad = ['path/to/test/AExtension'];
parent::setUp();
}
public function testDummy() {
// running a setup with active ext AExtension
$this->assertTrue(true);
}
}
// Bootstrap extension to globally load 'path/to/test/GlobalExtension'
class BTest extends ATest {
protected function setUp() {
parent::setUp();
}
public function testDummy() {
// running a setup with active ext AExtension and GlobalExtension
parent::testDummy();
}
}
With this scenario, class ATest would run an exclusive test setup, class BTest would reuse the tests of class ATest and extend the setup with own extensions. To test hooks or signals, this kind of handling would allow for testing side effects and loading order issues.
- Status changed from New to Under Review
- Target version changed from 8 LTS to next-patchlevel
- Status changed from Under Review to Rejected
Also available in: Atom
PDF