@@ -74,7 +74,6 @@ public function testSendOneDead()
74
74
$ t2 ->expects ($ this ->exactly (3 ))->method ('send ' );
75
75
$ t = new RoundRobinTransport ([$ t1 , $ t2 ]);
76
76
$ p = new \ReflectionProperty ($ t , 'cursor ' );
77
- $ p ->setAccessible (true );
78
77
$ p ->setValue ($ t , 0 );
79
78
$ t ->send (new RawMessage ('' ));
80
79
$ this ->assertTransports ($ t , 0 , [$ t1 ]);
@@ -92,7 +91,6 @@ public function testSendOneDeadAndRecoveryNotWithinRetryPeriod()
92
91
$ t2 ->expects ($ this ->once ())->method ('send ' )->will ($ this ->throwException (new TransportException ()));
93
92
$ t = new RoundRobinTransport ([$ t1 , $ t2 ], 60 );
94
93
$ p = new \ReflectionProperty ($ t , 'cursor ' );
95
- $ p ->setAccessible (true );
96
94
$ p ->setValue ($ t , 0 );
97
95
$ t ->send (new RawMessage ('' ));
98
96
$ this ->assertTransports ($ t , 1 , []);
@@ -114,7 +112,6 @@ public function testSendOneDeadAndRecoveryWithinRetryPeriod()
114
112
->willReturnOnConsecutiveCalls ($ this ->throwException (new TransportException ()));
115
113
$ t = new RoundRobinTransport ([$ t1 , $ t2 ], 3 );
116
114
$ p = new \ReflectionProperty ($ t , 'cursor ' );
117
- $ p ->setAccessible (true );
118
115
$ p ->setValue ($ t , 0 );
119
116
$ t ->send (new RawMessage ('' ));
120
117
$ this ->assertTransports ($ t , 1 , []);
@@ -130,14 +127,12 @@ public function testSendOneDeadAndRecoveryWithinRetryPeriod()
130
127
private function assertTransports (RoundRobinTransport $ transport , int $ cursor , array $ deadTransports )
131
128
{
132
129
$ p = new \ReflectionProperty ($ transport , 'cursor ' );
133
- $ p ->setAccessible (true );
134
130
if (-1 !== $ cursor ) {
135
131
$ this ->assertSame ($ cursor , $ p ->getValue ($ transport ));
136
132
}
137
133
$ cursor = $ p ->getValue ($ transport );
138
134
139
135
$ p = new \ReflectionProperty ($ transport , 'deadTransports ' );
140
- $ p ->setAccessible (true );
141
136
$ this ->assertSame ($ deadTransports , iterator_to_array ($ p ->getValue ($ transport )));
142
137
143
138
return $ cursor ;
0 commit comments