2018-07-04 23:37:22 +02:00
|
|
|
<?php
|
2020-02-09 15:45:36 +01:00
|
|
|
/**
|
2023-01-01 09:36:24 -05:00
|
|
|
* @copyright Copyright (C) 2010-2023, the Friendica project
|
2020-02-09 15:45:36 +01:00
|
|
|
*
|
|
|
|
* @license GNU AGPL version 3 or any later version
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
2018-07-04 23:37:22 +02:00
|
|
|
|
2018-07-05 20:57:31 +02:00
|
|
|
namespace Friendica\Test\src\Core\Lock;
|
2018-07-04 23:37:22 +02:00
|
|
|
|
2021-10-23 11:36:37 +02:00
|
|
|
use Friendica\Core\Lock\Type\DatabaseLock;
|
2023-01-15 16:12:25 +01:00
|
|
|
use Friendica\Test\Util\CreateDatabaseTrait;
|
2018-07-04 23:37:22 +02:00
|
|
|
|
|
|
|
class DatabaseLockDriverTest extends LockTest
|
|
|
|
{
|
2023-01-15 16:12:25 +01:00
|
|
|
use CreateDatabaseTrait;
|
2019-01-30 20:26:17 +01:00
|
|
|
|
|
|
|
protected $pid = 123;
|
|
|
|
|
2021-04-01 23:04:30 +02:00
|
|
|
protected function setUp(): void
|
2019-01-30 20:26:17 +01:00
|
|
|
{
|
2019-08-03 20:48:56 +02:00
|
|
|
$this->setUpVfsDir();
|
2019-01-30 20:26:17 +01:00
|
|
|
|
2021-04-01 23:04:30 +02:00
|
|
|
$this->setUpDb();
|
|
|
|
|
2019-01-30 20:26:17 +01:00
|
|
|
parent::setUp();
|
|
|
|
}
|
|
|
|
|
2018-07-04 23:37:22 +02:00
|
|
|
protected function getInstance()
|
|
|
|
{
|
2023-01-15 16:12:25 +01:00
|
|
|
return new DatabaseLock($this->getDbInstance(), $this->pid);
|
2019-03-04 21:28:36 +01:00
|
|
|
}
|
2021-04-01 23:04:30 +02:00
|
|
|
|
|
|
|
protected function tearDown(): void
|
|
|
|
{
|
|
|
|
parent::tearDown();
|
2023-01-15 16:12:25 +01:00
|
|
|
|
|
|
|
$this->tearDownDb();
|
2021-04-01 23:04:30 +02:00
|
|
|
}
|
2018-07-07 16:15:03 +02:00
|
|
|
}
|