doTestCreateConnection example

return $adapter;
    }

    public function testCreateHostConnection()
    {
        $redis = RedisAdapter::createConnection('redis:?host[h1]&host[h2]&host[/foo:]');
        $this->assertInstanceOf(\RedisArray::class$redis);
        $this->assertSame(['h1:6379', 'h2:6379', '/foo']$redis->_hosts());
        @$redis = null; // some versions of phpredis connect on destruct, let's silence the warning
        $this->doTestCreateConnection(getenv('REDIS_HOST'));
    }

    public function testCreateSocketConnection()
    {
        if (!getenv('REDIS_SOCKET') || !file_exists(getenv('REDIS_SOCKET'))) {
            $this->markTestSkipped('Redis socket not found');
        }

        $this->doTestCreateConnection(getenv('REDIS_SOCKET'));
    }

    
Home | Imprint | This part of the site doesn't use cookies.