Skip to content

Commit

Permalink
Merge pull request #920 from helhum/fix-tca-loading-order
Browse files Browse the repository at this point in the history
  • Loading branch information
helhum committed May 26, 2020
2 parents 6d9dd54 + c706957 commit 33547e2
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 19 deletions.
3 changes: 2 additions & 1 deletion Classes/Console/Core/Booting/RunLevel.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ function () {
function () {
Scripts::initializePersistence($this->container);
}
)
),
'helhum.typo3console:extensionconfiguration'
);
break;
case 'helhum.typo3console:authentication':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,17 @@ public function allUpdatesCanBePerformedWhenSpecified()
public function addingAndRemovingFieldsAndTablesIncludingVerbositySwitchWork()
{
self::installFixtureExtensionCode('ext_test');
$this->executeConsoleCommand('install:generatepackagestates', ['--activate-default']);
try {
$this->executeConsoleCommand('install:generatepackagestates', ['--activate-default']);

$output = $this->executeConsoleCommand('database:updateschema', ['*', '--verbose']);
$output = $this->executeConsoleCommand('database:updateschema', ['*', '--verbose']);

$this->assertContains('The following database schema updates were performed:', $output);
$this->assertContains('Change fields', $output);
$this->assertContains('Add tables', $output);

self::removeFixtureExtensionCode('ext_test');
$this->assertContains('The following database schema updates were performed:', $output);
$this->assertContains('Change fields', $output);
$this->assertContains('Add tables', $output);
} finally {
self::removeFixtureExtensionCode('ext_test');
}
$this->executeConsoleCommand('install:generatepackagestates', ['--activate-default']);

$output = $this->executeConsoleCommand('database:updateschema', ['*', '--verbose']);
Expand Down
24 changes: 13 additions & 11 deletions Tests/Console/Functional/Command/ExtensionCommandControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,21 @@ public function extensionSetupActiveWorksWhenExtensionChecksConfigInExtLocalConf
public function extensionSetupActivePerformsSchemaUpdate()
{
$this->backupDatabase();
self::installFixtureExtensionCode('ext_test');
$this->executeConsoleCommand('install:generatepackagestates', ['--activate-default']);

$output = $this->executeConsoleCommand('extension:setupactive');
$this->assertContains('ext_test', $output);
$this->assertContains('are now set up.', $output);
try {
self::installFixtureExtensionCode('ext_test');
$this->executeConsoleCommand('install:generatepackagestates', ['--activate-default']);

$output = $this->executeConsoleCommand('database:updateschema');
$this->assertContains('No schema updates were performed for update types:', $output);
$output = $this->executeConsoleCommand('extension:setupactive');
$this->assertContains('ext_test', $output);
$this->assertContains('are now set up.', $output);

self::removeFixtureExtensionCode('ext_test');
$this->executeConsoleCommand('install:generatepackagestates', ['--activate-default']);
$this->restoreDatabase();
$output = $this->executeConsoleCommand('database:updateschema');
$this->assertContains('No schema updates were performed for update types:', $output);
} finally {
self::removeFixtureExtensionCode('ext_test');
$this->executeConsoleCommand('install:generatepackagestates', ['--activate-default']);
$this->restoreDatabase();
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
declare(strict_types=1);

return [
'ctrl' => [
],
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
defined('TYPO3_MODE') or die();

if (empty($GLOBALS['TCA']['tx_exttest_cattest'])) {
throw new \RuntimeException('TCA not loaded before ext_tables.php', 1590494014);
}

0 comments on commit 33547e2

Please sign in to comment.