Conditions | 1 |
Paths | 1 |
Total Lines | 29 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function testLoadTopicThrowExceptionWhenImplementingTheWrongEventDispatcherInterface() |
||
13 | { |
||
14 | $app = new Application(); |
||
15 | $websocketAppClass = new \ReflectionClass(WebsocketApplication::class); |
||
16 | $method = $websocketAppClass->getMethod('loadTopic'); |
||
17 | $method->setAccessible(true); |
||
18 | $websocketApp = $websocketAppClass->newInstance($app); |
||
19 | |||
20 | $app->register(new SerializerServiceProvider()); |
||
21 | |||
22 | $app['sandstone.websocket.router'] = function () { |
||
23 | $wrongTopic = new WrongTopic('my-topic'); |
||
24 | $topicRouterMock = $this->getMockBuilder(TopicRouter::class)->disableOriginalConstructor()->getMock(); |
||
25 | |||
26 | $topicRouterMock |
||
27 | ->method('loadTopic') |
||
28 | ->willReturn($wrongTopic) |
||
29 | ; |
||
30 | |||
31 | return $topicRouterMock; |
||
32 | }; |
||
33 | |||
34 | $this->setExpectedExceptionRegExp( |
||
|
|||
35 | \LogicException::class, |
||
36 | '/WrongTopic seems to implements the wrong EventSubscriberInterface/' |
||
37 | ); |
||
38 | |||
39 | $method->invokeArgs($websocketApp, ['my-topic']); |
||
40 | } |
||
41 | } |
||
42 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.