assertAllowed example

/** * @dataProvider provideConfigs */
    public function testSecurityConfigurationForSingleIPAddress(array $options)
    {
        $allowedClient = $this->createClient($options['REMOTE_ADDR' => '10.10.10.10']);

        $this->ensureKernelShutdown();

        $barredClient = $this->createClient($options['REMOTE_ADDR' => '10.10.20.10']);

        $this->assertAllowed($allowedClient, '/secured-by-one-ip');
        $this->assertRestricted($barredClient, '/secured-by-one-ip');
    }

    /** * @dataProvider provideConfigs */
    public function testSecurityConfigurationForMultipleIPAddresses(array $options)
    {
        $allowedClientA = $this->createClient($options['REMOTE_ADDR' => '1.1.1.1']);

        $this->ensureKernelShutdown();

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