Skip to content

Commit 3668a8c

Browse files
committed
!!![TASK] change requirements
Supports v14 only
1 parent 8469278 commit 3668a8c

19 files changed

Lines changed: 350 additions & 93 deletions

.gitattributes

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
/Build/ export-ignore
12
/.gitattributes export-ignore
23
/.gitignore export-ignore
3-
/.travis.yml export-ignore
4-
/phpunit.xml.dist export-ignore
54
/Tests export-ignore
5+
/.github export-ignore
6+

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
TYPO3: [ '14' ]
12+
php: [ '8.2', '8.5']
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Set up PHP Version
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ matrix.php }}
22+
tools: composer:v2
23+
24+
- name: Start MySQL
25+
run: sudo /etc/init.d/mysql start
26+
27+
- name: Validate composer.json and composer.lock
28+
run: composer validate
29+
30+
- name: Cache dependencies
31+
uses: actions/cache@v4
32+
with:
33+
path: ~/.composer/cache
34+
key: dependencies-composer-${{ hashFiles('composer.json') }}
35+
36+
- name: Install composer dependencies
37+
run: |
38+
composer install --no-progress --no-interaction
39+
- name: Phpstan
40+
run: vendor/bin/phpstan analyze -c Build/phpstan.neon
41+
- name: Phpcsfix
42+
run: vendor/bin/php-cs-fixer fix --config=Build/php-cs-fixer.php --dry-run --stop-on-violation --using-cache=no
43+
- name: Unit Tests
44+
run: |
45+
vendor/bin/phpunit -c Build/phpunit/UnitTests.xml Tests/Unit
46+
- name: Functional Tests
47+
run: |
48+
export typo3DatabaseName="typo3";
49+
export typo3DatabaseHost="127.0.0.1";
50+
export typo3DatabaseUsername="root";
51+
export typo3DatabasePassword="root";
52+
vendor/bin/phpunit -c Build/phpunit/FunctionalTests.xml Tests/Functional

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Build
21
composer.lock
2+
Build/phpunit/.phpunit.result.cache
33
vendor
44
public
5-
.phpunit.result.cache
5+
.php-cs-fixer.cache

Build/php-cs-fixer.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
$config = \TYPO3\CodingStandards\CsFixerConfig::create();
4+
$config->getFinder()->exclude(['var', 'public', 'vendor'])->in(__DIR__ . '/..');
5+
$config->addRules([
6+
'nullable_type_declaration' => [
7+
'syntax' => 'question_mark',
8+
],
9+
'nullable_type_declaration_for_default_null_value' => true,
10+
]);
11+
return $config;

Build/phpstan.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parameters:
2+
level: 5
3+
paths:
4+
- %currentWorkingDirectory%/Classes
5+
- %currentWorkingDirectory%/Tests

Build/phpunit/FunctionalTests.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<phpunit
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
4+
backupGlobals="true"
5+
bootstrap="FunctionalTestsBootstrap.php"
6+
colors="true"
7+
stopOnError="false"
8+
stopOnFailure="false"
9+
stopOnIncomplete="false"
10+
stopOnSkipped="false"
11+
beStrictAboutTestsThatDoNotTestAnything="false"
12+
failOnWarning="true"
13+
failOnDeprecation="true"
14+
>
15+
<testsuites>
16+
<testsuite name="Functional tests">
17+
<directory>../../Tests/Functional/</directory>
18+
</testsuite>
19+
</testsuites>
20+
<php>
21+
<ini name="display_errors" value="1" />
22+
<env name="TYPO3_CONTEXT" value="Testing" />
23+
</php>
24+
</phpunit>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the TYPO3 CMS project.
5+
*
6+
* It is free software; you can redistribute it and/or modify it under
7+
* the terms of the GNU General Public License, either version 2
8+
* of the License, or any later version.
9+
*
10+
* For the full copyright and license information, please read the
11+
* LICENSE.txt file that was distributed with this source code.
12+
*
13+
* The TYPO3 project - inspiring people to share!
14+
*/
15+
16+
call_user_func(function () {
17+
$testbase = new \TYPO3\TestingFramework\Core\Testbase();
18+
$testbase->defineOriginalRootPath();
19+
$testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/tests');
20+
$testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/transient');
21+
});

Build/phpunit/UnitTests.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<phpunit
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
4+
backupGlobals="true"
5+
bootstrap="UnitTestsBootstrap.php"
6+
colors="true"
7+
processIsolation="false"
8+
stopOnError="false"
9+
stopOnFailure="false"
10+
stopOnIncomplete="false"
11+
stopOnSkipped="false"
12+
beStrictAboutTestsThatDoNotTestAnything="false"
13+
failOnWarning="true"
14+
>
15+
<testsuites>
16+
<testsuite name="Unit tests">
17+
<directory>../../Tests/Unit/</directory>
18+
</testsuite>
19+
</testsuites>
20+
<php>
21+
<ini name="display_errors" value="1" />
22+
<env name="TYPO3_CONTEXT" value="Testing" />
23+
</php>
24+
</phpunit>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the TYPO3 CMS project.
5+
*
6+
* It is free software; you can redistribute it and/or modify it under
7+
* the terms of the GNU General Public License, either version 2
8+
* of the License, or any later version.
9+
*
10+
* For the full copyright and license information, please read the
11+
* LICENSE.txt file that was distributed with this source code.
12+
*
13+
* The TYPO3 project - inspiring people to share!
14+
*/
15+
16+
/**
17+
* This file is defined in UnitTests.xml and called by phpunit
18+
* before instantiating the test suites.
19+
*/
20+
(static function () {
21+
$testbase = new \TYPO3\TestingFramework\Core\Testbase();
22+
23+
// These if's are for core testing (package typo3/cms) only. cms-composer-installer does
24+
// not create the autoload-include.php file that sets these env vars and sets composer
25+
// mode to true. testing-framework can not be used without composer anyway, so it is safe
26+
// to do this here. This way it does not matter if 'bin/phpunit' or 'vendor/phpunit/phpunit/phpunit'
27+
// is called to run the tests since the 'relative to entry script' path calculation within
28+
// SystemEnvironmentBuilder is not used. However, the binary must be called from the document
29+
// root since getWebRoot() uses 'getcwd()'.
30+
if (!getenv('TYPO3_PATH_ROOT')) {
31+
putenv('TYPO3_PATH_ROOT=' . rtrim($testbase->getWebRoot(), '/'));
32+
}
33+
if (!getenv('TYPO3_PATH_WEB')) {
34+
putenv('TYPO3_PATH_WEB=' . rtrim($testbase->getWebRoot(), '/'));
35+
}
36+
37+
$testbase->defineSitePath();
38+
39+
$requestType = \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_BE | \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_CLI;
40+
\TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(0, $requestType);
41+
42+
$testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3conf/ext');
43+
$testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3temp/assets');
44+
$testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3temp/var/tests');
45+
$testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3temp/var/transient');
46+
47+
// Retrieve an instance of class loader and inject to core bootstrap
48+
$classLoader = require $testbase->getPackagesPath() . '/autoload.php';
49+
\TYPO3\CMS\Core\Core\Bootstrap::initializeClassLoader($classLoader);
50+
51+
// Initialize default TYPO3_CONF_VARS
52+
$configurationManager = new \TYPO3\CMS\Core\Configuration\ConfigurationManager();
53+
$GLOBALS['TYPO3_CONF_VARS'] = $configurationManager->getDefaultConfiguration();
54+
55+
$cache = new \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend(
56+
'core',
57+
new \TYPO3\CMS\Core\Cache\Backend\NullBackend([])
58+
);
59+
// Set all packages to active
60+
$packageManager = \TYPO3\CMS\Core\Core\Bootstrap::createPackageManager(\TYPO3\CMS\Core\Package\UnitTestPackageManager::class, \TYPO3\CMS\Core\Core\Bootstrap::createPackageCache($cache));
61+
62+
\TYPO3\CMS\Core\Utility\GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Package\PackageManager::class, $packageManager);
63+
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::setPackageManager($packageManager);
64+
65+
$testbase->dumpClassLoadingInformation();
66+
67+
\TYPO3\CMS\Core\Utility\GeneralUtility::purgeInstances();
68+
})();

Build/sites/main/config.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
base: 'http://localhost/'
2+
baseVariants: { }
3+
errorHandling: { }
4+
languages:
5+
-
6+
title: english
7+
enabled: true
8+
base: /
9+
typo3Language: default
10+
locale: en_US.UTF-8
11+
iso-639-1: en
12+
navigationTitle: ''
13+
hreflang: ''
14+
direction: ''
15+
flag: global
16+
languageId: '0'
17+
websiteTitle: ''
18+
rootPageId: 1
19+
routes: { }
20+
websiteTitle: 'Testing'

0 commit comments

Comments
 (0)