Skip to content

Commit

Permalink
Merge pull request #1118 from helhum/feature/cleanup-fixes-upgrade-pr…
Browse files Browse the repository at this point in the history
…eparations
  • Loading branch information
helhum committed Feb 26, 2023
2 parents d01b92e + 89b67f2 commit e5e9171
Show file tree
Hide file tree
Showing 32 changed files with 55 additions and 194 deletions.
3 changes: 2 additions & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@

$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('vendor')
->exclude('config')
->exclude('public')
->exclude('var')
->exclude('vendor')
->exclude('Documentation')
->exclude('Libraries')
->notName('ext_emconf.php')
Expand Down
5 changes: 5 additions & 0 deletions Classes/Console/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ protected static function getPackagePath(): string
return __DIR__ . '/../../';
}

protected static function getPackageName(): string
{
return 'helhum/typo3-console';
}

public function getFactories(): array
{
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use Symfony\Component\Console\Output\OutputInterface;
use TYPO3\CMS\Core\Console\CommandRegistry;
use TYPO3\CMS\Core\Core\BootService;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Fluid\View\StandaloneView;

Expand All @@ -50,7 +51,6 @@ class CommandReferenceRenderCommand extends Command
'database:updateschema',
'frontend:request',
'install:setup',
'install:generatepackagestates',
'install:fixfolderstructure',
'install:extensionsetupifpossible',
'install:environmentandfolders',
Expand All @@ -61,8 +61,6 @@ class CommandReferenceRenderCommand extends Command
'install:actionneedsexecution',
'install:lock',
'install:unlock',
'upgrade:checkextensioncompatibility',
'upgrade:checkextensionconstraints',
'upgrade:list',
'upgrade:prepare',
'upgrade:run',
Expand Down Expand Up @@ -158,7 +156,7 @@ protected function renderReference(OutputInterface $output): int
'acceptValue' => $option->acceptValue() ? 'yes' : 'no',
'isValueRequired' => $option->isValueRequired() ? 'yes' : 'no',
'isMultiple' => $option->isArray() ? 'yes' : 'no',
'default' => str_replace(["\n", TYPO3_version], ['', '<Current-TYPO3-Version>'], var_export($option->getDefault(), true)),
'default' => str_replace(["\n", (string)(new Typo3Version())], ['', '<Current-TYPO3-Version>'], var_export($option->getDefault(), true)),
];
}

Expand Down
5 changes: 5 additions & 0 deletions Packages/CreateReferenceCommand/src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ protected static function getPackagePath(): string
return __DIR__ . '/../';
}

protected static function getPackageName(): string
{
return 'typo3-console/create-reference-command';
}

public function getFactories(): array
{
return [
Expand Down
2 changes: 1 addition & 1 deletion Packages/SqlCommand/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "typo3-console/sql-command",
"description": "TYPO3 Console command that executes SQL",
"license": "GPL-2.0-or-later",
"type": "typo3-console-command",
"type": "typo3-cms-extension",
"authors": [
{
"name": "Helmut Hummel",
Expand Down
5 changes: 5 additions & 0 deletions Packages/SqlCommand/src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ protected static function getPackagePath(): string
return __DIR__ . '/../';
}

protected static function getPackageName(): string
{
return 'typo3-console/sql-command';
}

public function getFactories(): array
{
return [
Expand Down
11 changes: 2 additions & 9 deletions Tests/Console/Functional/Command/AbstractCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Process\ExecutableFinder;
use Symfony\Component\Process\Process;
use TYPO3\CMS\Core\Utility\GeneralUtility;

abstract class AbstractCommandTest extends TestCase
{
Expand Down Expand Up @@ -140,11 +139,7 @@ protected function restoreDatabase()
*/
protected static function installFixtureExtensionCode($extensionKey)
{
$sourcePath = dirname(__DIR__) . '/Fixtures/Extensions/' . $extensionKey;
$targetPath = getenv('TYPO3_PATH_ROOT') . '/typo3conf/ext/' . $extensionKey;
self::copyDirectory($sourcePath, $targetPath);
GeneralUtility::rmdir(getenv('TYPO3_PATH_APP') . '/var/cache', true);
self::executeComposerCommand(['du']);
self::executeComposerCommand(['req', '--dev', 'typo3-console/tests-' . $extensionKey, '0.1.0', '--no-interaction']);
}

/**
Expand Down Expand Up @@ -181,9 +176,7 @@ protected static function copyDirectory($sourcePath, $targetPath, array $ignored
*/
protected static function removeFixtureExtensionCode($extensionKey)
{
self::removeDirectory(getenv('TYPO3_PATH_ROOT') . '/typo3conf/ext/' . $extensionKey);
GeneralUtility::rmdir(getenv('TYPO3_PATH_APP') . '/var/cache', true);
self::executeComposerCommand(['du']);
self::executeComposerCommand(['remove', '--dev', 'typo3-console/tests-' . $extensionKey, '--no-interaction']);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"name": "typo3-console/tests-ext-roken-sqlb",
"name": "typo3-console/tests-ext_broken_sql",
"type": "typo3-cms-extension",
"version": "0.1.0",
"extra": {
"typo3/cms": {
"extension-key": "ext_broken_sql"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"name": "typo3-console/ext-command",
"name": "typo3-console/tests-ext_command",
"type": "typo3-cms-extension",
"version": "0.1.0",
"license": "GPL-2.0-or-later",
"type": "typo3-cms-extension",
"description": "Test extension with command",
"require": {
"typo3/cms-core": "*"
},
"autoload": {
"psr-4": {
"Helhum\\Typo3Console\\Tests\\Functional\\Fixtures\\Extensions\\ext_command\\": ""
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"name": "typo3-console/tests-ext-config",
"name": "typo3-console/tests-ext_config",
"type": "typo3-cms-extension",
"version": "0.1.0",
"extra": {
"typo3/cms": {
"extension-key": "ext_config"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?php
defined('TYPO3_MODE') or die();
$extensionConfiguration = new \TYPO3\CMS\Core\Configuration\ExtensionConfiguration();
$extensionConfiguration->get('ext_config', 'activateTest');
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"name": "typo3-console/tests-ext-test",
"name": "typo3-console/tests-ext_test",
"type": "typo3-cms-extension",
"version": "0.1.0",
"extra": {
"typo3/cms": {
"extension-key": "ext_test"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
<?php
defined('TYPO3_MODE') or die();

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::makeCategorizable(
'ext_test',
'tx_exttest_cattest'
);

if (empty($TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['test'])) {
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['test'] = [];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php
defined('TYPO3_MODE') or die();

if (empty($GLOBALS['TCA']['tx_exttest_cattest'])) {
throw new \RuntimeException('TCA not loaded before ext_tables.php', 1590494014);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
declare(strict_types=1);
defined('TYPO3_MODE') or die();
// @deprecated with TYPO3 12, this fixture can be removed
if ((new \TYPO3\CMS\Core\Information\Typo3Version())->getMajorVersion() < 12) {
$cacheManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\CacheManager::class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"name": "typo3-console/tests-ext-test-cache",
"name": "typo3-console/tests-ext_test_cache",
"type": "typo3-cms-extension",
"version": "0.1.0",
"extra": {
"typo3/cms": {
"extension-key": "ext_test_cache"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"name": "typo3-console/tests-ext-upgrade",
"name": "typo3-console/tests-ext_upgrade",
"type": "typo3-cms-extension",
"version": "0.1.0",
"extra": {
"typo3/cms": {
"extension-key": "ext_upgrade"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?php
defined('TYPO3_MODE') or die();

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['normalWizard']
= \Helhum\Typo3Console\Tests\Functional\Fixtures\Extensions\ext_upgrade\src\NormalUpgradeWizard::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['repeatableWizard']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"name": "typo3-console/tests-ext-with-dep",
"name": "typo3-console/tests-ext_with_dep",
"type": "typo3-cms-extension",
"version": "0.1.0",
"extra": {
"typo3/cms": {
"extension-key": "ext_with_dep"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ databaseData:
adminUserName:
value: 'admin'
adminPassword:
value: 'password'
value: 'Password1!'
siteName:
value: 'New TYPO3 Console site'

Expand Down

0 comments on commit e5e9171

Please sign in to comment.