Completed
Push — master ( 9de1be...100987 )
by David
8s
created

ContextInvalidationLogoutHandlerTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 4
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testLogout() 0 15 1
1
<?php
2
3
/*
4
 * This file is part of the FOSHttpCacheBundle package.
5
 *
6
 * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace FOS\HttpCacheBundle\Tests\Functional\Security\Http\Logout;
13
14
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
15
use Symfony\Component\BrowserKit\Cookie;
16
17
class ContextInvalidationLogoutHandlerTest extends WebTestCase
18
{
19
    public function testLogout()
20
    {
21
        $client = static::createClient();
22
        $client->getContainer()->mock(
0 ignored issues
show
Bug introduced by
The method mock() does not seem to exist on object<Symfony\Component...ion\ContainerInterface>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
23
            'fos_http_cache.proxy_client.varnish',
24
            '\FOS\HttpCache\ProxyClient\Varnish'
25
        )
26
            ->shouldReceive('ban')->once()->with(array('accept' => 'application/vnd.fos.user-context-hash', 'Cookie' => '.*test.*'))
27
            ->shouldReceive('ban')->once()->with(array('accept' => 'application/vnd.fos.user-context-hash', 'Authorization' => '.*test.*'))
28
            ->shouldReceive('flush')->once()
29
        ;
30
31
        $client->getCookieJar()->set(new Cookie('TESTSESSID', 'test'));
32
        $client->request('GET', '/secured_area/logout');
33
    }
34
}
35