1 | <?php |
||
21 | class RestLogoutHandlerTest extends TestCase |
||
22 | { |
||
23 | use PHPUnit5CompatTrait; |
||
24 | |||
25 | /** |
||
26 | * @var \PHPUnit_Framework_MockObject_MockObject |
||
27 | */ |
||
28 | private $configResolver; |
||
29 | |||
30 | /** |
||
31 | * @var \PHPUnit_Framework_MockObject_MockObject |
||
32 | */ |
||
33 | private $session; |
||
34 | |||
35 | protected function setUp() |
||
36 | { |
||
37 | parent::setUp(); |
||
38 | $this->configResolver = $this->createMock(ConfigResolverInterface::class); |
||
39 | $this->session = $this->createMock(SessionInterface::class); |
||
40 | } |
||
41 | |||
42 | public function testLogoutWithoutSiteaccessSessionSettings() |
||
43 | { |
||
44 | $sessionId = 'eZSESSID'; |
||
45 | $this->session |
||
46 | ->expects($this->once()) |
||
47 | ->method('getName') |
||
48 | ->will($this->returnValue($sessionId)); |
||
49 | $request = new Request(); |
||
50 | $request->setSession($this->session); |
||
51 | $request->attributes->set('is_rest_request', true); |
||
52 | $this->configResolver |
||
53 | ->expects($this->once()) |
||
54 | ->method('getParameter') |
||
55 | ->with('session') |
||
56 | ->will($this->returnValue([])); |
||
57 | $response = new Response(); |
||
58 | $response->headers = $this->createMock(ResponseHeaderBag::class); |
||
|
|||
59 | $response->headers |
||
60 | ->expects($this->once()) |
||
61 | ->method('clearCookie') |
||
62 | ->with($sessionId); |
||
63 | $logoutHandler = new RestLogoutHandler($this->configResolver); |
||
64 | $logoutHandler->logout( |
||
65 | $request, |
||
66 | $response, |
||
67 | $this->createMock(TokenInterface::class) |
||
68 | ); |
||
69 | } |
||
70 | |||
71 | public function testLogoutWithSiteaccessSessionSettings() |
||
103 | |||
104 | public function testLogoutNotRest() |
||
105 | { |
||
127 | } |
||
128 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..