You are here

public function RedisLockTest::testBackendLockRelease in Redis 8

Tests backend release functionality.

Overrides LockTest::testBackendLockRelease

File

tests/src/Kernel/RedisLockTest.php, line 52

Class

RedisLockTest
Tests the Redis non-persistent lock backend.

Namespace

Drupal\Tests\redis\Kernel

Code

public function testBackendLockRelease() {
  $redis_interface = self::getRedisInterfaceEnv();

  // Verify that the correct lock backend is being instantiated by the
  // factory.
  $this
    ->assertInstanceOf('\\Drupal\\redis\\Lock\\' . $redis_interface, $this->lock);

  // Verify that a lock that has never been acquired is marked as available.
  // @todo Remove this line when #3002640 lands.
  // @see https://www.drupal.org/project/drupal/issues/3002640
  $this
    ->assertTrue($this->lock
    ->lockMayBeAvailable('lock_a'));
  parent::testBackendLockRelease();
}