Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 999d8e5

Browse files
theroolmage2pratik
authored andcommitted
Minor refactoring to update code quality
1 parent 31b7f07 commit 999d8e5

File tree

1 file changed

+25
-11
lines changed

1 file changed

+25
-11
lines changed

dev/tests/integration/testsuite/Magento/Integration/Model/ConfigBasedIntegrationManagerTest.php

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ConfigBasedIntegrationManagerTest extends \PHPUnit\Framework\TestCase
1414
/**
1515
* @var \PHPUnit_Framework_MockObject_MockObject
1616
*/
17-
protected $consolidatedConfigMock;
17+
protected $consolidatedMock;
1818

1919
/**
2020
* @var \Magento\Integration\Model\ConfigBasedIntegrationManager
@@ -26,35 +26,49 @@ class ConfigBasedIntegrationManagerTest extends \PHPUnit\Framework\TestCase
2626
*/
2727
protected $integrationService;
2828

29+
/**
30+
* @var \Magento\TestFramework\ObjectManager
31+
*/
32+
protected $objectManager;
33+
34+
/**
35+
* @inheritdoc
36+
*/
2937
protected function setUp()
3038
{
3139
parent::setUp();
32-
/**
33-
* @var $objectManager \Magento\TestFramework\ObjectManager
34-
*/
35-
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
36-
$this->consolidatedConfigMock = $this->createMock(\Magento\Integration\Model\ConsolidatedConfig::class);
37-
$objectManager->addSharedInstance(
38-
$this->consolidatedConfigMock,
40+
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
41+
$this->consolidatedMock = $this->createMock(\Magento\Integration\Model\ConsolidatedConfig::class);
42+
$this->objectManager->addSharedInstance(
43+
$this->consolidatedMock,
3944
\Magento\Integration\Model\ConsolidatedConfig::class
4045
);
41-
$this->integrationManager = $objectManager->create(
46+
$this->integrationManager = $this->objectManager->create(
4247
\Magento\Integration\Model\ConfigBasedIntegrationManager::class,
4348
[]
4449
);
45-
$this->integrationService = $objectManager->create(
50+
$this->integrationService = $this->objectManager->create(
4651
\Magento\Integration\Api\IntegrationServiceInterface::class,
4752
[]
4853
);
4954
}
5055

56+
/**
57+
* @inheritdoc
58+
*/
59+
protected function tearDown()
60+
{
61+
$this->objectManager->removeSharedInstance(\Magento\Integration\Model\ConsolidatedConfig::class);
62+
parent::tearDown();
63+
}
64+
5165
/**
5266
* @magentoDbIsolation enabled
5367
*/
5468
public function testProcessConfigBasedIntegrations()
5569
{
5670
$newIntegrations = require __DIR__ . '/Config/Consolidated/_files/integration.php';
57-
$this->consolidatedConfigMock
71+
$this->consolidatedMock
5872
->expects($this->any())
5973
->method('getIntegrations')
6074
->willReturn($newIntegrations);

0 commit comments

Comments
 (0)