2019-04-20 17:37:57 +02:00
|
|
|
<?php
|
2020-02-09 15:45:36 +01:00
|
|
|
/**
|
2023-01-01 15:36:24 +01: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/>.
|
|
|
|
*
|
|
|
|
*/
|
2019-04-20 17:37:57 +02:00
|
|
|
|
|
|
|
namespace Friendica\Test\src\Core\Lock;
|
|
|
|
|
2021-10-23 10:49:27 +02:00
|
|
|
use Friendica\Core\Cache\Type\APCuCache;
|
2021-10-23 11:36:37 +02:00
|
|
|
use Friendica\Core\Lock\Type\CacheLock;
|
2019-04-20 17:37:57 +02:00
|
|
|
|
2019-09-23 14:31:13 +02:00
|
|
|
/**
|
|
|
|
* @group APCU
|
|
|
|
*/
|
2019-08-04 10:26:53 +02:00
|
|
|
class APCuCacheLockTest extends LockTest
|
2019-04-20 17:37:57 +02:00
|
|
|
{
|
2021-04-01 23:04:30 +02:00
|
|
|
protected function setUp(): void
|
2019-04-20 18:11:24 +02:00
|
|
|
{
|
|
|
|
if (!APCuCache::isAvailable()) {
|
2020-10-18 20:31:57 +02:00
|
|
|
static::markTestSkipped('APCu is not available');
|
2019-04-20 18:11:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
parent::setUp();
|
|
|
|
}
|
|
|
|
|
2019-04-20 17:37:57 +02:00
|
|
|
protected function getInstance()
|
|
|
|
{
|
2021-10-23 11:36:37 +02:00
|
|
|
return new \Friendica\Core\Lock\Type\CacheLock(new APCuCache('localhost'));
|
2019-04-20 17:37:57 +02:00
|
|
|
}
|
|
|
|
}
|