mirror of
https://github.com/friendica/friendica
synced 2025-04-23 21:10:12 +00:00
Fix tests
- Fix InstallerTest case - Fix native function mocking - Add returntype for Unit-Tests - Fixing ExtendedPDO test troubles - Fix wrong class inheritance path for DatabaseTestTrait.php - Fix SyslogLogger Server Exception for PHP8 - Add user/contact to database.fixture.php - Avoid invalid rollbacks for test setup in PHP8
This commit is contained in:
parent
8cab5edea9
commit
02e6dff6a0
53 changed files with 171 additions and 69 deletions
|
@ -67,8 +67,9 @@ class ExtendedPDO extends PDO
|
|||
*/
|
||||
public function beginTransaction()
|
||||
{
|
||||
if($this->_transactionDepth == 0 || !$this->hasSavepoint()) {
|
||||
if($this->_transactionDepth <= 0 || !$this->hasSavepoint()) {
|
||||
parent::beginTransaction();
|
||||
$this->_transactionDepth = $this->_transactionDepth < 0 ? 0 : $this->_transactionDepth;
|
||||
} else {
|
||||
$this->exec("SAVEPOINT LEVEL{$this->_transactionDepth}");
|
||||
}
|
||||
|
@ -85,8 +86,9 @@ class ExtendedPDO extends PDO
|
|||
{
|
||||
$this->_transactionDepth--;
|
||||
|
||||
if($this->_transactionDepth == 0 || !$this->hasSavepoint()) {
|
||||
if($this->_transactionDepth <= 0 || !$this->hasSavepoint()) {
|
||||
parent::commit();
|
||||
$this->_transactionDepth = $this->_transactionDepth < 0 ? 0 : $this->_transactionDepth;
|
||||
} else {
|
||||
$this->exec("RELEASE SAVEPOINT LEVEL{$this->_transactionDepth}");
|
||||
}
|
||||
|
@ -100,8 +102,7 @@ class ExtendedPDO extends PDO
|
|||
*/
|
||||
public function rollBack()
|
||||
{
|
||||
|
||||
if ($this->_transactionDepth == 0) {
|
||||
if ($this->_transactionDepth <= 0) {
|
||||
throw new PDOException('Rollback error : There is no transaction started');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue