RedisReverseProxyGateway example

private Client $client;

    private RedisReverseProxyGateway $gateway;

    protected function setUp(): void
    {
        parent::setUp();

        $this->mockHandler = new MockHandler();
        $this->client = new Client(['handler' => HandlerStack::create($this->mockHandler)]);
        $this->gateway = new RedisReverseProxyGateway(
            ['http://localhost'],
            ['method' => 'BAN', 'headers' => []],
            ['method' => 'PURGE', 'headers' => ['foo' => '1'], 'urls' => ['/']],
            3,
            $this->createMock(\Redis::class),
            $this->client
        );
    }

    public function testClear(): void
    {
        
private \Redis&MockObject $redis;

    private MockHandler $mockHandler;

    protected function setUp(): void
    {
        parent::setUp();

        $this->redis = $this->createMock(\Redis::class);
        $this->mockHandler = new MockHandler();

        $this->gateway = new RedisReverseProxyGateway(
            ['http://localhost'],
            ['method' => 'BAN', 'headers' => []],
            ['method' => 'BAN', 'headers' => [], 'urls' => []],
            3,
            $this->redis,
            new Client(['handler' => HandlerStack::create($this->mockHandler)])
        );
    }

    public function testDecorated(): void
    {
        
Home | Imprint | This part of the site doesn't use cookies.