From 4ee30cb7beec161df1174d4145b63c4d77fa37dd Mon Sep 17 00:00:00 2001 From: jisse Reitsma Date: Tue, 17 Nov 2020 14:39:56 +0100 Subject: [PATCH] Better workaround for TestSetter --- .../TestFramework/Bootstrap/DocBlock.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/framework/ReachDigital/TestFramework/Bootstrap/DocBlock.php b/framework/ReachDigital/TestFramework/Bootstrap/DocBlock.php index 59aa71a..caa0109 100644 --- a/framework/ReachDigital/TestFramework/Bootstrap/DocBlock.php +++ b/framework/ReachDigital/TestFramework/Bootstrap/DocBlock.php @@ -17,6 +17,13 @@ protected function _getSubscribers(\Magento\TestFramework\Application $applicati // 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(), @@ -35,11 +42,7 @@ protected function _getSubscribers(\Magento\TestFramework\Application $applicati new \Magento\TestFramework\Annotation\Cache($application), new \Magento\TestFramework\Annotation\AdminConfigFixture(), new \Magento\TestFramework\Annotation\ConfigFixture(), - ]; - - if (class_exists(\Magento\TestFramework\Workaround\Override\Fixture\Resolver\TestSetter::class)) { - $subscribers[] = new \Magento\TestFramework\Workaround\Override\Fixture\Resolver\TestSetter(); - } + ]); return $subscribers; }