1 | <?php |
||
9 | class HandshakeTest extends TestCase |
||
10 | { |
||
11 | /** |
||
12 | * @var Handshake |
||
13 | */ |
||
14 | private $handshake; |
||
15 | |||
16 | /** |
||
17 | * @return void |
||
18 | */ |
||
19 | public function setUp(): void |
||
23 | |||
24 | /** |
||
25 | * @expectedException \TBolier\RethinkQL\Connection\Socket\Exception |
||
26 | * @expectedExceptionMessage Not connected |
||
27 | * @return void |
||
28 | */ |
||
29 | public function testExceptionThrownOnStreamNotWritable(): void |
||
37 | |||
38 | /** |
||
39 | * @expectedException \TBolier\RethinkQL\Connection\Socket\Exception |
||
40 | * @expectedExceptionMessage Foobar |
||
41 | * @return void |
||
42 | */ |
||
43 | public function testExceptionThrownOnError(): void |
||
53 | |||
54 | /** |
||
55 | * @expectedException \TBolier\RethinkQL\Connection\Socket\Exception |
||
56 | * @expectedExceptionMessage Foobar |
||
57 | * @return void |
||
58 | */ |
||
59 | public function testExceptionThrownOnVerifyProtocolWithError(): void |
||
69 | |||
70 | /** |
||
71 | * @expectedException \TBolier\RethinkQL\Connection\Socket\Exception |
||
72 | * @expectedExceptionMessage Unsupported protocol version. |
||
73 | * @return void |
||
74 | */ |
||
75 | public function testExceptionThrownOnInvalidProtocolVersion(): void |
||
85 | |||
86 | |||
87 | /** |
||
88 | * @expectedException \TBolier\RethinkQL\Connection\Socket\Exception |
||
89 | * @expectedExceptionMessage Woops! |
||
90 | * @return void |
||
91 | */ |
||
92 | public function testExceptionThrownOnProtocolError(): void |
||
102 | } |
||
103 |
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: