You are here

final protected function Redis_Tests_Path_PathUnitTestCase::getBackend in Redis 7.3

Get cache backend

Return value

Redis_Path_HashLookupInterface

3 calls to Redis_Tests_Path_PathUnitTestCase::getBackend()
Redis_Tests_Path_PathUnitTestCase::testCaseInsensitivePathLookup in lib/Redis/Tests/Path/PathUnitTestCase.php
Tests that lookup is case insensitive
Redis_Tests_Path_PathUnitTestCase::testPathLookup in lib/Redis/Tests/Path/PathUnitTestCase.php
Tests basic functionnality
Redis_Tests_Path_PathUnitTestCase::testSomeEdgeCaseFalseNegative in lib/Redis/Tests/Path/PathUnitTestCase.php
Tests https://www.drupal.org/node/2728831

File

lib/Redis/Tests/Path/PathUnitTestCase.php, line 18

Class

Redis_Tests_Path_PathUnitTestCase
Bugfixes made over time test class.

Code

protected final function getBackend($name = null) {
  if (null === $name) {

    // This is needed to avoid conflict between tests, each test
    // seems to use the same Redis namespace and conflicts are
    // possible.
    $name = 'cache' . self::$id++;
  }
  $className = Redis_Client::getClass(Redis_Client::REDIS_IMPL_PATH);
  $hashLookup = new $className(Redis_Client::getClient(), 'path', Redis_Client::getDefaultPrefix('path'));
  return $hashLookup;
}