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 77
88namespace Magento \Framework \Lock \Backend ;
99
10+ use Magento \Framework \App \ResourceConnection ;
11+ use Magento \Framework \App \DeploymentConfig ;
12+
1013/**
1114 * \Magento\Framework\Lock\Backend\Database test case
1215 */
@@ -25,7 +28,10 @@ class DatabaseTest extends \PHPUnit\Framework\TestCase
2528 protected function setUp ()
2629 {
2730 $ 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 );
2935 }
3036
3137 public function testLockAndUnlock ()
Original file line number Diff line number Diff line change 55 */
66namespace Magento \MessageQueue \Model \Cron ;
77
8+ use Magento \Framework \App \DeploymentConfig ;
9+ use Magento \Framework \App \ResourceConnection ;
10+ use Magento \Framework \Lock \Backend \Database ;
811use Magento \Framework \MessageQueue \Consumer \ConfigInterface as ConsumerConfigInterface ;
912use Magento \Framework \Lock \LockManagerInterface ;
1013use Magento \Framework \App \DeploymentConfig \FileReader ;
@@ -83,7 +86,10 @@ protected function setUp()
8386 $ this ->objectManager = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ();
8487 $ this ->shellMock = $ this ->getMockBuilder (ShellInterface::class)
8588 ->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 );
8793 $ this ->consumerConfig = $ this ->objectManager ->get (ConsumerConfigInterface::class);
8894 $ this ->reader = $ this ->objectManager ->get (FileReader::class);
8995 $ this ->filesystem = $ this ->objectManager ->get (Filesystem::class);
You can’t perform that action at this time.
0 commit comments