Skip to content

Commit

Permalink
[BUGFIX] Add tests that cover latest regressions
Browse files Browse the repository at this point in the history
  • Loading branch information
helhum committed Dec 18, 2019
1 parent 7fc8f6c commit 0392b5d
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 0 deletions.
1 change: 1 addition & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,6 @@ return PhpCsFixer\Config::create()
->exclude('Libraries')
->notName('ext_emconf.php')
->notName('ext_localconf.php')
->notName('ext_tables.php')
->notName('ComposerPackagesCommands.php')
);
1 change: 1 addition & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,5 @@ finder:
not-name:
- "ext_emconf.php"
- "ext_localconf.php"
- "ext_tables.php"
- "ComposerPackagesCommands.php"
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,27 @@ public function setupEvaluatesStepFileIfGiven()
$this->assertNotContains('Set up extensions', $output);
}

/**
* @test
*/
public function deprecatedSetupOptionNonInteractiveWorks()
{
$output = $this->executeConsoleCommand(
'install:setup',
[
'--non-interactive',
'--skip-integrity-check',
],
[
'TYPO3_INSTALL_SETUP_STEPS' => __DIR__ . '/../../Fixtures/Install/custom-install.yaml',
]
);
$this->assertContains('Successfully installed TYPO3 CMS!', $output);
$this->assertContains('Custom step', $output);
$this->assertContains('Option --non-interactive is deprecated. Please use --no-interaction instead.', $output);
$this->assertNotContains('Set up extensions', $output);
}

/**
* @test
*/
Expand Down
30 changes: 30 additions & 0 deletions Tests/Console/Functional/Command/UpgradeCommandControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,36 @@ public function checkExtensionConstraintsReturnsErrorCodeOnFailure()
$this->removeFixtureExtensionCode('ext_test');
}

/**
* @test
*/
public function checkExtensionCompatibilityReportsBrokenCodeInExtTables()
{
$this->installFixtureExtensionCode('ext_broken_ext_tables');
$this->executeConsoleCommand('install:generatepackagestates');

$output = $this->commandDispatcher->executeCommand('upgrade:checkextensioncompatibility', ['ext_broken_ext_tables']);
$this->assertSame('false', $output);

$this->removeFixtureExtensionCode('ext_broken_ext_tables');
$this->executeConsoleCommand('install:generatepackagestates');
}

/**
* @test
*/
public function checkExtensionCompatibilityDoeNotReportBrokenCodeInExtTablesWithConfigOnlyCheck()
{
$this->installFixtureExtensionCode('ext_broken_ext_tables');
$this->executeConsoleCommand('install:generatepackagestates');

$output = $this->commandDispatcher->executeCommand('upgrade:checkextensioncompatibility', ['ext_broken_ext_tables', '--config-only']);
$this->assertSame('true', $output);

$this->removeFixtureExtensionCode('ext_broken_ext_tables');
$this->executeConsoleCommand('install:generatepackagestates');
}

/**
* @test
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
$EM_CONF[$_EXTKEY] = [
'title' => 'Test Extension',
'description' => 'Extension fixture to prove extension compat check is working correctly',
'category' => 'cli',
'state' => 'stable',
'uploadfolder' => 0,
'createDirs' => '',
'modify_tables' => '',
'clearCacheOnLoad' => 0,
'author' => 'Helmut Hummel',
'author_email' => 'info@helhum.io',
'author_company' => 'helhum.io',
'version' => '0.1.0',
'constraints' => [
'depends' => [
'typo3' => '9.5.0-',
],
'conflicts' => [
],
'suggests' => [
],
],
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
defined('TYPO3_MODE') or die();
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
defined('TYPO3_MODE') or die();

throw new \Exception('broken', 1576697261);

0 comments on commit 0392b5d

Please sign in to comment.