1 | <?php |
||
21 | * |
||
22 | * @package SfCod\SocketIoBundle\Tests |
||
23 | */ |
||
24 | class BroadcastTest extends TestCase |
||
25 | { |
||
26 | use LoadTrait; |
||
27 | |||
28 | /** |
||
29 | * @var Broadcast |
||
30 | */ |
||
31 | private $broadcast; |
||
32 | private $eventManagerMock; |
||
33 | private $processMock; |
||
34 | |||
35 | /** |
||
36 | * Set up test. |
||
37 | */ |
||
38 | protected function setUp() |
||
50 | |||
51 | /** |
||
52 | * Test on. |
||
53 | * |
||
54 | * @throws \Exception |
||
55 | */ |
||
56 | public function testOn() |
||
63 | |||
64 | /** |
||
65 | * Test process. |
||
66 | */ |
||
67 | public function testProcess() |
||
83 | |||
84 | /** |
||
85 | */ |
||
86 | public function testEmit() |
||
87 | { |
||
88 | $data = range(1, 10); |
||
89 | |||
90 | $handler = $this->getMockBuilder([EventInterface::class, EventPublisherInterface::class])->getMock(); |
||
91 | $handler |
||
92 | ->expects(self::once()) |
||
93 | ->method('setPayload') |
||
94 | ->with($data); |
||
95 | $handler |
||
96 | ->expects(self::once()) |
||
97 | ->method('fire'); |
||
98 | $this->eventManagerMock->method('resolve')->willReturn($handler); |
||
109 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: