File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
dev/tests/integration/testsuite/Magento Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 7
7
8
8
namespace Magento \Framework \Lock \Backend ;
9
9
10
+ use Magento \Framework \App \ResourceConnection ;
11
+ use Magento \Framework \App \DeploymentConfig ;
12
+
10
13
/**
11
14
* \Magento\Framework\Lock\Backend\Database test case
12
15
*/
@@ -25,7 +28,10 @@ class DatabaseTest extends \PHPUnit\Framework\TestCase
25
28
protected function setUp ()
26
29
{
27
30
$ this ->objectManager = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ();
28
- $ this ->model = $ this ->objectManager ->create (\Magento \Framework \Lock \Backend \Database::class);
31
+ $ resourceConnection = $ this ->objectManager ->create (ResourceConnection::class);
32
+ $ deploymentConfig = $ this ->objectManager ->create (DeploymentConfig::class);
33
+ // create object with new otherwise dummy locker is created because of di.xml preference for integration tests
34
+ $ this ->model = new Database ($ resourceConnection , $ deploymentConfig );
29
35
}
30
36
31
37
public function testLockAndUnlock ()
Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \MessageQueue \Model \Cron ;
7
7
8
+ use Magento \Framework \App \DeploymentConfig ;
9
+ use Magento \Framework \App \ResourceConnection ;
10
+ use Magento \Framework \Lock \Backend \Database ;
8
11
use Magento \Framework \MessageQueue \Consumer \ConfigInterface as ConsumerConfigInterface ;
9
12
use Magento \Framework \Lock \LockManagerInterface ;
10
13
use Magento \Framework \App \DeploymentConfig \FileReader ;
@@ -83,7 +86,10 @@ protected function setUp()
83
86
$ this ->objectManager = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ();
84
87
$ this ->shellMock = $ this ->getMockBuilder (ShellInterface::class)
85
88
->getMockForAbstractClass ();
86
- $ this ->lockManager = $ this ->objectManager ->get (LockManagerInterface::class);
89
+ $ resourceConnection = $ this ->objectManager ->create (ResourceConnection::class);
90
+ $ deploymentConfig = $ this ->objectManager ->create (DeploymentConfig::class);
91
+ // create object with new otherwise dummy locker is created because of di.xml preference for integration tests
92
+ $ this ->lockManager = new Database ($ resourceConnection , $ deploymentConfig );
87
93
$ this ->consumerConfig = $ this ->objectManager ->get (ConsumerConfigInterface::class);
88
94
$ this ->reader = $ this ->objectManager ->get (FileReader::class);
89
95
$ this ->filesystem = $ this ->objectManager ->get (Filesystem::class);
You can’t perform that action at this time.
0 commit comments