@@ -14,7 +14,7 @@ class ConfigBasedIntegrationManagerTest extends \PHPUnit\Framework\TestCase
14
14
/**
15
15
* @var \PHPUnit_Framework_MockObject_MockObject
16
16
*/
17
- protected $ consolidatedConfigMock ;
17
+ protected $ consolidatedMock ;
18
18
19
19
/**
20
20
* @var \Magento\Integration\Model\ConfigBasedIntegrationManager
@@ -26,35 +26,49 @@ class ConfigBasedIntegrationManagerTest extends \PHPUnit\Framework\TestCase
26
26
*/
27
27
protected $ integrationService ;
28
28
29
+ /**
30
+ * @var \Magento\TestFramework\ObjectManager
31
+ */
32
+ protected $ objectManager ;
33
+
34
+ /**
35
+ * @inheritdoc
36
+ */
29
37
protected function setUp ()
30
38
{
31
39
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 ,
39
44
\Magento \Integration \Model \ConsolidatedConfig::class
40
45
);
41
- $ this ->integrationManager = $ objectManager ->create (
46
+ $ this ->integrationManager = $ this -> objectManager ->create (
42
47
\Magento \Integration \Model \ConfigBasedIntegrationManager::class,
43
48
[]
44
49
);
45
- $ this ->integrationService = $ objectManager ->create (
50
+ $ this ->integrationService = $ this -> objectManager ->create (
46
51
\Magento \Integration \Api \IntegrationServiceInterface::class,
47
52
[]
48
53
);
49
54
}
50
55
56
+ /**
57
+ * @inheritdoc
58
+ */
59
+ protected function tearDown ()
60
+ {
61
+ $ this ->objectManager ->removeSharedInstance (\Magento \Integration \Model \ConsolidatedConfig::class);
62
+ parent ::tearDown ();
63
+ }
64
+
51
65
/**
52
66
* @magentoDbIsolation enabled
53
67
*/
54
68
public function testProcessConfigBasedIntegrations ()
55
69
{
56
70
$ newIntegrations = require __DIR__ . '/Config/Consolidated/_files/integration.php ' ;
57
- $ this ->consolidatedConfigMock
71
+ $ this ->consolidatedMock
58
72
->expects ($ this ->any ())
59
73
->method ('getIntegrations ' )
60
74
->willReturn ($ newIntegrations );
0 commit comments