10
10
use Magento \Framework \App \DeploymentConfig ;
11
11
use Magento \Framework \App \ResourceConnection ;
12
12
use Magento \Framework \DB \Adapter \AdapterInterface ;
13
- use Magento \Framework \Exception \AlreadyExistsException ;
14
13
use Magento \Framework \Lock \Backend \Database ;
15
14
use Magento \Framework \TestFramework \Unit \Helper \ObjectManager ;
16
15
use PHPUnit \Framework \MockObject \MockObject ;
@@ -90,7 +89,6 @@ protected function setUp(): void
90
89
}
91
90
92
91
/**
93
- * @throws AlreadyExistsException
94
92
* @throws \Zend_Db_Statement_Exception
95
93
*/
96
94
public function testLock ()
@@ -107,7 +105,6 @@ public function testLock()
107
105
}
108
106
109
107
/**
110
- * @throws AlreadyExistsException
111
108
* @throws \Zend_Db_Statement_Exception
112
109
*/
113
110
public function testlockWithTooLongName ()
@@ -124,12 +121,10 @@ public function testlockWithTooLongName()
124
121
}
125
122
126
123
/**
127
- * @throws AlreadyExistsException
128
124
* @throws \Zend_Db_Statement_Exception
129
125
*/
130
126
public function testlockWithAlreadyAcquiredLockInSameSession ()
131
127
{
132
- $ this ->expectException ('Magento\Framework\Exception\AlreadyExistsException ' );
133
128
$ this ->deploymentConfig
134
129
->method ('isDbAvailable ' )
135
130
->with ()
@@ -138,12 +133,11 @@ public function testlockWithAlreadyAcquiredLockInSameSession()
138
133
->method ('fetchColumn ' )
139
134
->willReturn (true );
140
135
141
- $ this ->database ->lock ('testLock ' );
142
- $ this ->database ->lock ('differentLock ' );
136
+ $ this ->assertTrue ( $ this -> database ->lock ('testLock ' ) );
137
+ $ this ->assertTrue ( $ this -> database ->lock ('differentLock ' ) );
143
138
}
144
139
145
140
/**
146
- * @throws AlreadyExistsException
147
141
* @throws \Zend_Db_Statement_Exception
148
142
*/
149
143
public function testLockWithUnavailableDeploymentConfig ()
0 commit comments