Project

General

Profile

Actions

Task #72450

closed

Instance path for test instance configuration

Added by Artus Kolanowski over 8 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Could have
Assignee:
-
Category:
Tests
Target version:
-
Start date:
2015-12-27
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
easy
Sprint Focus:

Description

In a functional test I need to test the result of a mail function. My approach is to use mbox as transport. But mbox needs an absolute path which should be a folder within the test instance. The problem is that the instance path private and it's set after the configuration was written and thus I can't use a path within the test instance. So it would be very helpful to have the instance path as constant in the functional test case. My proposal would be a dynamic generated constant FULL_QUALIFIED_TEST_CASE_CLASS_NAME_PATH which contains the instance path and is available on object instance level (so not static). Additionally the class `\TYPO3\CMS\Core\Tests\FunctionalTestCaseBootstrapUtility` should provide two static public methods:

/**
 * Calculates a "unique" identifier for the given test case class name.
 *
 * @param string $testCaseClassName
 * @return string
 */
public static function getIdentifier($testCaseClassName) {
  return substr(sha1($testCaseClassName), 0, 7);
}
/**
 * Calculates path to TYPO3 CMS test installation the given test case class name.
 *
 * @param string $testCaseClassName
 * @return string
 */
public static function getInstancePath($testCaseClassName) {
  return ORIGINAL_ROOT . 'typo3temp/functional-' . static::getIdentifier($testCaseClassName);
}

If already implemented this so if want I could contribute.


Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #71574: Property "instancePath" not accessible in a TestCaseClosed2015-11-14

Actions
Actions

Also available in: Atom PDF