1 | <?php |
||
10 | class HandshakeTest extends TestCase |
||
11 | { |
||
12 | /** |
||
13 | * @var Handshake |
||
14 | */ |
||
15 | private $handshake; |
||
16 | |||
17 | /** |
||
18 | * @return void |
||
19 | */ |
||
20 | public function setUp(): void |
||
24 | |||
25 | /** |
||
26 | * @expectedException \TBolier\RethinkQL\Connection\Socket\Exception |
||
27 | * @expectedExceptionMessage Not connected |
||
28 | * @return void |
||
29 | */ |
||
30 | public function testExceptionThrownOnStreamNotWritable(): void |
||
38 | |||
39 | /** |
||
40 | * @expectedException \TBolier\RethinkQL\Connection\Socket\Exception |
||
41 | * @expectedExceptionMessage Foobar |
||
42 | * @return void |
||
43 | */ |
||
44 | public function testExceptionThrownOnError(): void |
||
54 | |||
55 | /** |
||
56 | * @expectedException \TBolier\RethinkQL\Connection\Socket\Exception |
||
57 | * @expectedExceptionMessage Foobar |
||
58 | * @return void |
||
59 | */ |
||
60 | public function testExceptionThrownOnVerifyProtocolWithError(): void |
||
70 | |||
71 | /** |
||
72 | * @expectedException \TBolier\RethinkQL\Connection\Socket\Exception |
||
73 | * @expectedExceptionMessage Unsupported protocol version. |
||
74 | * @return void |
||
75 | */ |
||
76 | public function testExceptionThrownOnInvalidProtocolVersion(): void |
||
86 | |||
87 | |||
88 | /** |
||
89 | * @expectedException \TBolier\RethinkQL\Connection\Socket\Exception |
||
90 | * @expectedExceptionMessage Woops! |
||
91 | * @return void |
||
92 | */ |
||
93 | public function testExceptionThrownOnProtocolError(): void |
||
104 | } |
||
105 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: