Commit 816476c2 authored by Stefan Bürk's avatar Stefan Bürk
Browse files

[TASK] Upgrade to codeception/codeception 5.x

Codeception released new major version 5, which
unblocks upgrading to symfony 6 components.
This patch raises codeception only, thus acting as a
pre-patch to raise symfony requirements.

Codeception 5 is hard to impossible with core v11,
so this patch is v12 only: Codeception 5 requires
PHP 8.0, so we'd have to support both 4 and 5 in
v11 to allow testing with older PHP versions. This
would result in various headaches since some API
changes in codeception 5 are hard breaking in PHP,
especially due to changed class property type hints.
We'll thus keep codeception 4 in v11 and go with
codeception 5 in v12.

Minor acceptance test related adaptions are needed:

* Replaced config option `path.log` with `path.output`
* Added proper property type because of inheritance to
  codeception setup classes
* Ensure method return type compatibility
* Use `actor`instead of `class name` in suite config
* Create acceptance split files in proper folder to
  ensure group filterin...
parent 25128d45
......@@ -43,7 +43,7 @@ nbproject
/Build/testing-docker/local/macos_passwd
/typo3/sysext/*/Resources/Private/TypeScript/*.js
/typo3/sysext/*/Resources/Public/JavaScript/*.js.map
typo3/sysext/core/Tests/Acceptance/AcceptanceTests-Job-*
/typo3/sysext/core/Tests/AcceptanceTests-Job-*
#
# TypeScript stuff
.baseDir.ts
......
......@@ -99,7 +99,7 @@ cleanTestFiles() {
# > test related
echo -n "Clean test related files ... " ; rm -rf \
../../../Build/phpunit/FunctionalTests-Job-*.xml \
../../../typo3/sysext/core/Tests/Acceptance/AcceptanceTests-Job-* \
../../../typo3/sysext/core/Tests/AcceptanceTests-Job-* \
../../../typo3/sysext/core/Tests/Acceptance/Support/_generated \
../../../typo3temp/var/tests/ ; \
echo "done"
......
......@@ -64,7 +64,7 @@ class SplitAcceptanceTests extends NodeVisitorAbstract
$output = new ConsoleOutput();
// delete any existing split job files first
$targetDirectory = __DIR__ . '/../../typo3/sysext/core/Tests/Acceptance/';
$targetDirectory = __DIR__ . '/../../typo3/sysext/core/Tests/';
$targetFileNamePrefix = 'AcceptanceTests-Job-';
$filesInTargetDir = Finder::create()->files()->in($targetDirectory)->name($targetFileNamePrefix . '*');
foreach ($filesInTargetDir as $file) {
......@@ -232,7 +232,7 @@ class AcceptanceTestCaseVisitor extends NodeVisitorAbstract
);
foreach ($matches['annotations'] as $possibleDataProvider) {
// See if this test has a data provider attached
if (strpos($possibleDataProvider, 'dataProvider') === 0) {
if (str_starts_with($possibleDataProvider, 'dataProvider')) {
$test['dataProvider'] = trim(ltrim($possibleDataProvider, 'dataProvider'));
}
}
......
This diff is collapsed.
class_name: ApplicationTester
actor: ApplicationTester
modules:
enabled:
- WebDriver:
......
......@@ -35,7 +35,7 @@ class InstallMysqlCoreEnvironment extends Extension
/**
* @var array Default configuration values
*/
protected $config = [
protected array $config = [
'typo3InstallMysqlDatabaseHost' => '127.0.0.1',
'typo3InstallMysqlDatabasePassword' => '',
'typo3InstallMysqlDatabaseUsername' => 'root',
......@@ -45,7 +45,7 @@ class InstallMysqlCoreEnvironment extends Extension
/**
* Override configuration from ENV if needed
*/
public function _initialize()
public function _initialize(): void
{
$env = getenv('typo3InstallMysqlDatabaseHost');
$this->config['typo3InstallMysqlDatabaseHost'] = is_string($env)
......
......@@ -35,7 +35,7 @@ class InstallPostgresqlCoreEnvironment extends Extension
/**
* @var array Default configuration values
*/
protected $config = [
protected array $config = [
'typo3InstallPostgresqlDatabaseHost' => '127.0.0.1',
'typo3InstallPostgresqlDatabasePort' => 5432,
'typo3InstallPostgresqlDatabasePassword' => '',
......@@ -46,7 +46,7 @@ class InstallPostgresqlCoreEnvironment extends Extension
/**
* Override configuration from ENV if needed
*/
public function _initialize()
public function _initialize(): void
{
$env = getenv('typo3InstallPostgresqlDatabaseHost');
$this->config['typo3InstallPostgresqlDatabaseHost'] = is_string($env)
......
......@@ -2,7 +2,7 @@ namespace: TYPO3\CMS\Core\Tests\Acceptance\Support
paths:
tests: Acceptance
data: .
log: ../../../../typo3temp/var/tests/AcceptanceReports
output: ../../../../typo3temp/var/tests/AcceptanceReports
support: Acceptance/Support
settings:
colors: true
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment