Skip to content

Commit

Permalink
Merge pull request #23 from jissereitsma/issue-fixed-2.4.1
Browse files Browse the repository at this point in the history
Issue fixed 2.4.1
  • Loading branch information
paales authored Nov 24, 2020
2 parents aae963d + a997565 commit bbe4399
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Support for new overrides feature introduced in Magento 2.4.0 / 2.4.1


## [1.1.0]
Expand Down
13 changes: 11 additions & 2 deletions framework/ReachDigital/TestFramework/Bootstrap/DocBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ class DocBlock extends \Magento\TestFramework\Bootstrap\DocBlock

protected function _getSubscribers(\Magento\TestFramework\Application $application)
{
return [
$subscribers = [
new \Magento\TestFramework\Workaround\Segfault(),
// new \Magento\TestFramework\Workaround\Cleanup\TestCaseProperties(),
// new \Magento\TestFramework\Workaround\Cleanup\StaticProperties(),
new \Magento\TestFramework\Isolation\WorkingDirectory(),
new \Magento\TestFramework\Isolation\DeploymentConfig(),
];

if (class_exists(\Magento\TestFramework\Workaround\Override\Fixture\Resolver\TestSetter::class)) {
$subscribers[] = new \Magento\TestFramework\Workaround\Override\Fixture\Resolver\TestSetter();
}

$subscribers = array_merge($subscribers, [
new \ReachDigital\TestFramework\Annotation\AppIsolation($application),
new \Magento\TestFramework\Annotation\IndexerDimensionMode($application),
new \Magento\TestFramework\Isolation\AppConfig(),
Expand All @@ -35,6 +42,8 @@ protected function _getSubscribers(\Magento\TestFramework\Application $applicati
new \Magento\TestFramework\Annotation\Cache($application),
new \Magento\TestFramework\Annotation\AdminConfigFixture(),
new \Magento\TestFramework\Annotation\ConfigFixture(),
];
]);

return $subscribers;
}
}
16 changes: 15 additions & 1 deletion framework/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,22 @@
new Magento\Framework\App\Utility\Files(new ComponentRegistrar(), $dirSearch, $themePackageList)
);

if (class_exists(\Magento\TestFramework\Workaround\Override\Config::class)) {
/** @var \Magento\TestFramework\Workaround\Override\Config $overrideConfig */
$overrideConfig = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
Magento\TestFramework\Workaround\Override\Config::class
);
$overrideConfig->init();
Magento\TestFramework\Workaround\Override\Config::setInstance($overrideConfig);
Magento\TestFramework\Workaround\Override\Fixture\Resolver::setInstance(
new \Magento\TestFramework\Workaround\Override\Fixture\Resolver($overrideConfig)
);
} else {
$overrideConfig = null;
}

/* Unset declared global variables to release the PHPUnit from maintaining their values between tests */
unset($testsBaseDir, $logWriter, $settings, $shell, $application, $bootstrap);
unset($testsBaseDir, $logWriter, $settings, $shell, $application, $bootstrap, $overrideConfig);
} catch (Exception $e) {
// phpcs:ignore Magento2.Security.LanguageConstruct.DirectOutput
echo $e . PHP_EOL;
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<!-- Connection parameters for MongoDB library tests -->
<!--<const name="MONGODB_CONNECTION_STRING" value="mongodb://localhost:27017"/>-->
<!--<const name="MONGODB_DATABASE_NAME" value="magento_integration_tests"/>-->
<const name="USE_OVERRIDE_CONFIG" value="enabled"/>
</php>
<!-- Test listeners -->
<listeners>
Expand Down

0 comments on commit bbe4399

Please sign in to comment.