File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed
lib/internal/Magento/Framework/Lock Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change 10
10
use Magento \Framework \App \DeploymentConfig ;
11
11
use Magento \Framework \App \ResourceConnection ;
12
12
use Magento \Framework \Config \ConfigOptionsListConstants ;
13
- use Magento \Framework \Exception \AlreadyExistsException ;
14
- use Magento \Framework \Phrase ;
15
13
use Magento \Framework \DB \ExpressionConverter ;
14
+ use Magento \Framework \Exception \FileSystemException ;
15
+ use Magento \Framework \Exception \RuntimeException ;
16
16
17
17
/**
18
18
* Implementation of the lock manager on the basis of MySQL.
@@ -68,7 +68,8 @@ public function __construct(
68
68
* @param string $name lock name
69
69
* @param int $timeout How long to wait lock acquisition in seconds, negative value means infinite timeout
70
70
* @return bool
71
- * @throws AlreadyExistsException
71
+ * @throws FileSystemException
72
+ * @throws RuntimeException
72
73
* @throws \Zend_Db_Statement_Exception
73
74
*/
74
75
public function lock (string $ name , int $ timeout = -1 ): bool
Original file line number Diff line number Diff line change @@ -85,7 +85,6 @@ protected function setUp()
85
85
}
86
86
87
87
/**
88
- * @throws \Magento\Framework\Exception\AlreadyExistsException
89
88
* @throws \Zend_Db_Statement_Exception
90
89
*/
91
90
public function testLock ()
@@ -102,7 +101,6 @@ public function testLock()
102
101
}
103
102
104
103
/**
105
- * @throws \Magento\Framework\Exception\AlreadyExistsException
106
104
* @throws \Zend_Db_Statement_Exception
107
105
*/
108
106
public function testlockWithTooLongName ()
@@ -119,9 +117,7 @@ public function testlockWithTooLongName()
119
117
}
120
118
121
119
/**
122
- * @throws \Magento\Framework\Exception\AlreadyExistsException
123
120
* @throws \Zend_Db_Statement_Exception
124
- * @expectedException \Magento\Framework\Exception\AlreadyExistsException
125
121
*/
126
122
public function testlockWithAlreadyAcquiredLockInSameSession ()
127
123
{
@@ -133,12 +129,11 @@ public function testlockWithAlreadyAcquiredLockInSameSession()
133
129
->method ('fetchColumn ' )
134
130
->willReturn (true );
135
131
136
- $ this ->database ->lock ('testLock ' );
137
- $ this ->database ->lock ('differentLock ' );
132
+ $ this ->assertTrue ( $ this -> database ->lock ('testLock ' ) );
133
+ $ this ->assertTrue ( $ this -> database ->lock ('differentLock ' ) );
138
134
}
139
135
140
136
/**
141
- * @throws \Magento\Framework\Exception\AlreadyExistsException
142
137
* @throws \Zend_Db_Statement_Exception
143
138
*/
144
139
public function testLockWithUnavailableDeploymentConfig ()
You can’t perform that action at this time.
0 commit comments