Project

General

Profile

Actions

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.

Status:
Rejected
Priority:
Should have
Category:
Tests
Target version:
Start date:
2017-03-05
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Sprint Focus:

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.

Actions #1

Updated by Anja Leichsenring over 7 years ago

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.

Actions #2

Updated by Gerrit Code Review over 7 years ago

  • Status changed from New to Under Review

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51956

Actions #3

Updated by Gerrit Code Review over 7 years ago

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51957

Actions #4

Updated by Gerrit Code Review over 7 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51957

Actions #5

Updated by Gerrit Code Review over 7 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51957

Actions #6

Updated by Benni Mack over 7 years ago

  • Target version changed from 8 LTS to next-patchlevel
Actions #7

Updated by Benni Mack almost 7 years ago

  • Status changed from Under Review to Rejected
Actions

Also available in: Atom PDF