1010use Magento \Framework \App \DeploymentConfig ;
1111use Magento \Framework \App \ResourceConnection ;
1212use Magento \Framework \DB \Adapter \AdapterInterface ;
13- use Magento \Framework \Exception \AlreadyExistsException ;
1413use Magento \Framework \Lock \Backend \Database ;
1514use Magento \Framework \TestFramework \Unit \Helper \ObjectManager ;
1615use PHPUnit \Framework \MockObject \MockObject ;
@@ -90,7 +89,6 @@ protected function setUp(): void
9089 }
9190
9291 /**
93- * @throws AlreadyExistsException
9492 * @throws \Zend_Db_Statement_Exception
9593 */
9694 public function testLock ()
@@ -107,7 +105,6 @@ public function testLock()
107105 }
108106
109107 /**
110- * @throws AlreadyExistsException
111108 * @throws \Zend_Db_Statement_Exception
112109 */
113110 public function testlockWithTooLongName ()
@@ -124,12 +121,10 @@ public function testlockWithTooLongName()
124121 }
125122
126123 /**
127- * @throws AlreadyExistsException
128124 * @throws \Zend_Db_Statement_Exception
129125 */
130126 public function testlockWithAlreadyAcquiredLockInSameSession ()
131127 {
132- $ this ->expectException ('Magento\Framework\Exception\AlreadyExistsException ' );
133128 $ this ->deploymentConfig
134129 ->method ('isDbAvailable ' )
135130 ->with ()
@@ -138,12 +133,11 @@ public function testlockWithAlreadyAcquiredLockInSameSession()
138133 ->method ('fetchColumn ' )
139134 ->willReturn (true );
140135
141- $ this ->database ->lock ('testLock ' );
142- $ this ->database ->lock ('differentLock ' );
136+ $ this ->assertTrue ( $ this -> database ->lock ('testLock ' ) );
137+ $ this ->assertTrue ( $ this -> database ->lock ('differentLock ' ) );
143138 }
144139
145140 /**
146- * @throws AlreadyExistsException
147141 * @throws \Zend_Db_Statement_Exception
148142 */
149143 public function testLockWithUnavailableDeploymentConfig ()
0 commit comments