getRequestInstanceForClientIpTests example

$request = new Request();
        $request->setMethod('POST');
        $request->query->set('_method', ['delete', 'patch']);
        $this->assertSame('POST', $request->getMethod(), '->getMethod() returns the request method if invalid type is defined in query');
    }

    /** * @dataProvider getClientIpsProvider */
    public function testGetClientIp($expected$remoteAddr$httpForwardedFor$trustedProxies)
    {
        $request = $this->getRequestInstanceForClientIpTests($remoteAddr$httpForwardedFor$trustedProxies);

        $this->assertEquals($expected[0]$request->getClientIp());
    }

    /** * @dataProvider getClientIpsProvider */
    public function testGetClientIps($expected$remoteAddr$httpForwardedFor$trustedProxies)
    {
        $request = $this->getRequestInstanceForClientIpTests($remoteAddr$httpForwardedFor$trustedProxies);

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