Files
sls/vendor/phpmyadmin/motranslator/tests/Cache/ApcuDisabledTest.php
2024-12-13 06:44:07 +01:00

28 lines
768 B
PHP

<?php
declare(strict_types=1);
namespace PhpMyAdmin\MoTranslator\Tests\Cache;
use PhpMyAdmin\MoTranslator\Cache\ApcuCache;
use PhpMyAdmin\MoTranslator\CacheException;
use PhpMyAdmin\MoTranslator\MoParser;
use PHPUnit\Framework\TestCase;
use function apcu_enabled;
use function function_exists;
final class ApcuDisabledTest extends TestCase
{
public function testConstructorApcuNotEnabledThrowsException(): void
{
if (function_exists('apcu_enabled') && apcu_enabled()) {
$this->markTestSkipped('ext-apcu is enabled');
}
$this->expectException(CacheException::class);
$this->expectExceptionMessage('ACPu extension must be installed and enabled');
new ApcuCache(new MoParser(null), 'foo', 'bar');
}
}