@@ -46,9 +46,6 @@ public function testSendFirstWork()
46
46
$ t2 = $ this ->createMock (TransportInterface::class);
47
47
$ t2 ->expects ($ this ->never ())->method ('send ' );
48
48
$ t = new FailoverTransport ([$ t1 , $ t2 ]);
49
- $ p = new \ReflectionProperty (RoundRobinTransport::class, 'cursor ' );
50
- $ p ->setAccessible (true );
51
- $ p ->setValue ($ t , 0 );
52
49
$ t ->send (new RawMessage ('' ));
53
50
$ this ->assertTransports ($ t , 1 , []);
54
51
$ t ->send (new RawMessage ('' ));
@@ -77,9 +74,6 @@ public function testSendOneDead()
77
74
$ t2 = $ this ->createMock (TransportInterface::class);
78
75
$ t2 ->expects ($ this ->exactly (3 ))->method ('send ' );
79
76
$ t = new FailoverTransport ([$ t1 , $ t2 ]);
80
- $ p = new \ReflectionProperty (RoundRobinTransport::class, 'cursor ' );
81
- $ p ->setAccessible (true );
82
- $ p ->setValue ($ t , 0 );
83
77
$ t ->send (new RawMessage ('' ));
84
78
$ this ->assertTransports ($ t , 0 , [$ t1 ]);
85
79
$ t ->send (new RawMessage ('' ));
@@ -99,9 +93,6 @@ public function testSendOneDeadAndRecoveryWithinRetryPeriod()
99
93
$ t2 ->expects ($ this ->at (2 ))->method ('send ' );
100
94
$ t2 ->expects ($ this ->at (3 ))->method ('send ' )->will ($ this ->throwException (new TransportException ()));
101
95
$ t = new FailoverTransport ([$ t1 , $ t2 ], 6 );
102
- $ p = new \ReflectionProperty (RoundRobinTransport::class, 'cursor ' );
103
- $ p ->setAccessible (true );
104
- $ p ->setValue ($ t , 0 );
105
96
$ t ->send (new RawMessage ('' )); // t1>fail - t2>sent
106
97
$ this ->assertTransports ($ t , 0 , [$ t1 ]);
107
98
sleep (4 );
@@ -148,9 +139,6 @@ public function testSendOneDeadButRecover()
148
139
$ t2 ->expects ($ this ->at (1 ))->method ('send ' );
149
140
$ t2 ->expects ($ this ->at (2 ))->method ('send ' )->will ($ this ->throwException (new TransportException ()));
150
141
$ t = new FailoverTransport ([$ t1 , $ t2 ], 1 );
151
- $ p = new \ReflectionProperty (RoundRobinTransport::class, 'cursor ' );
152
- $ p ->setAccessible (true );
153
- $ p ->setValue ($ t , 0 );
154
142
$ t ->send (new RawMessage ('' ));
155
143
sleep (1 );
156
144
$ t ->send (new RawMessage ('' ));
0 commit comments