You are here

public function Redis_Tests_Lock_LockingUnitTestCase::createLockBackend in Redis 7.3

Create a new lock backend with a generated lock id

Return value

Redis_Lock_BackendInterface

2 calls to Redis_Tests_Lock_LockingUnitTestCase::createLockBackend()
Redis_Tests_Lock_LockingUnitTestCase::testLock in lib/Redis/Tests/Lock/LockingUnitTestCase.php
Redis_Tests_Lock_LockingUnitTestCase::testReleaseAll in lib/Redis/Tests/Lock/LockingUnitTestCase.php

File

lib/Redis/Tests/Lock/LockingUnitTestCase.php, line 38

Class

Redis_Tests_Lock_LockingUnitTestCase

Code

public function createLockBackend() {
  if (!$this
    ->getLockBackendClass()) {
    throw new \Exception("Lock backend class does not exist");
  }
  $className = Redis_Client::getClass(Redis_Client::REDIS_IMPL_LOCK);
  return $this->backends[] = new $className(Redis_Client::getClient(), Redis_Client::getDefaultPrefix('lock'));
}