@@ -22,7 +22,10 @@ public function setUpBrowser()
2222 $ this ->browser = new Browser (null , $ this ->loop );
2323
2424 $ ref = new \ReflectionProperty ($ this ->browser , 'transaction ' );
25- $ ref ->setAccessible (true );
25+
26+ if (PHP_VERSION_ID < 80100 ) {
27+ $ ref ->setAccessible (true );
28+ }
2629 $ ref ->setValue ($ this ->browser , $ this ->sender );
2730 }
2831
@@ -31,11 +34,17 @@ public function testConstructWithoutLoopAssignsLoopAutomatically()
3134 $ browser = new Browser ();
3235
3336 $ ref = new \ReflectionProperty ($ browser , 'transaction ' );
34- $ ref ->setAccessible (true );
37+
38+ if (PHP_VERSION_ID < 80100 ) {
39+ $ ref ->setAccessible (true );
40+ }
3541 $ transaction = $ ref ->getValue ($ browser );
3642
3743 $ ref = new \ReflectionProperty ($ transaction , 'loop ' );
38- $ ref ->setAccessible (true );
44+
45+ if (PHP_VERSION_ID < 80100 ) {
46+ $ ref ->setAccessible (true );
47+ }
3948 $ loop = $ ref ->getValue ($ transaction );
4049
4150 $ this ->assertInstanceOf ('React\EventLoop\LoopInterface ' , $ loop );
@@ -48,23 +57,38 @@ public function testConstructWithConnectorAssignsGivenConnector()
4857 $ browser = new Browser ($ connector );
4958
5059 $ ref = new \ReflectionProperty ($ browser , 'transaction ' );
51- $ ref ->setAccessible (true );
60+
61+ if (PHP_VERSION_ID < 80100 ) {
62+ $ ref ->setAccessible (true );
63+ }
5264 $ transaction = $ ref ->getValue ($ browser );
5365
5466 $ ref = new \ReflectionProperty ($ transaction , 'sender ' );
55- $ ref ->setAccessible (true );
67+
68+ if (PHP_VERSION_ID < 80100 ) {
69+ $ ref ->setAccessible (true );
70+ }
5671 $ sender = $ ref ->getValue ($ transaction );
5772
5873 $ ref = new \ReflectionProperty ($ sender , 'http ' );
59- $ ref ->setAccessible (true );
74+
75+ if (PHP_VERSION_ID < 80100 ) {
76+ $ ref ->setAccessible (true );
77+ }
6078 $ client = $ ref ->getValue ($ sender );
6179
6280 $ ref = new \ReflectionProperty ($ client , 'connectionManager ' );
63- $ ref ->setAccessible (true );
81+
82+ if (PHP_VERSION_ID < 80100 ) {
83+ $ ref ->setAccessible (true );
84+ }
6485 $ connectionManager = $ ref ->getValue ($ client );
6586
6687 $ ref = new \ReflectionProperty ($ connectionManager , 'connector ' );
67- $ ref ->setAccessible (true );
88+
89+ if (PHP_VERSION_ID < 80100 ) {
90+ $ ref ->setAccessible (true );
91+ }
6892 $ ret = $ ref ->getValue ($ connectionManager );
6993
7094 $ this ->assertSame ($ connector , $ ret );
@@ -77,23 +101,38 @@ public function testConstructWithConnectorWithLegacySignatureAssignsGivenConnect
77101 $ browser = new Browser (null , $ connector );
78102
79103 $ ref = new \ReflectionProperty ($ browser , 'transaction ' );
80- $ ref ->setAccessible (true );
104+
105+ if (PHP_VERSION_ID < 80100 ) {
106+ $ ref ->setAccessible (true );
107+ }
81108 $ transaction = $ ref ->getValue ($ browser );
82109
83110 $ ref = new \ReflectionProperty ($ transaction , 'sender ' );
84- $ ref ->setAccessible (true );
111+
112+ if (PHP_VERSION_ID < 80100 ) {
113+ $ ref ->setAccessible (true );
114+ }
85115 $ sender = $ ref ->getValue ($ transaction );
86116
87117 $ ref = new \ReflectionProperty ($ sender , 'http ' );
88- $ ref ->setAccessible (true );
118+
119+ if (PHP_VERSION_ID < 80100 ) {
120+ $ ref ->setAccessible (true );
121+ }
89122 $ client = $ ref ->getValue ($ sender );
90123
91124 $ ref = new \ReflectionProperty ($ client , 'connectionManager ' );
92- $ ref ->setAccessible (true );
125+
126+ if (PHP_VERSION_ID < 80100 ) {
127+ $ ref ->setAccessible (true );
128+ }
93129 $ connectionManager = $ ref ->getValue ($ client );
94130
95131 $ ref = new \ReflectionProperty ($ connectionManager , 'connector ' );
96- $ ref ->setAccessible (true );
132+
133+ if (PHP_VERSION_ID < 80100 ) {
134+ $ ref ->setAccessible (true );
135+ }
97136 $ ret = $ ref ->getValue ($ connectionManager );
98137
99138 $ this ->assertSame ($ connector , $ ret );
@@ -104,11 +143,17 @@ public function testConstructWithLoopAssignsGivenLoop()
104143 $ browser = new Browser (null , $ this ->loop );
105144
106145 $ ref = new \ReflectionProperty ($ browser , 'transaction ' );
107- $ ref ->setAccessible (true );
146+
147+ if (PHP_VERSION_ID < 80100 ) {
148+ $ ref ->setAccessible (true );
149+ }
108150 $ transaction = $ ref ->getValue ($ browser );
109151
110152 $ ref = new \ReflectionProperty ($ transaction , 'loop ' );
111- $ ref ->setAccessible (true );
153+
154+ if (PHP_VERSION_ID < 80100 ) {
155+ $ ref ->setAccessible (true );
156+ }
112157 $ loop = $ ref ->getValue ($ transaction );
113158
114159 $ this ->assertSame ($ this ->loop , $ loop );
@@ -119,11 +164,17 @@ public function testConstructWithLoopWithLegacySignatureAssignsGivenLoop()
119164 $ browser = new Browser ($ this ->loop );
120165
121166 $ ref = new \ReflectionProperty ($ browser , 'transaction ' );
122- $ ref ->setAccessible (true );
167+
168+ if (PHP_VERSION_ID < 80100 ) {
169+ $ ref ->setAccessible (true );
170+ }
123171 $ transaction = $ ref ->getValue ($ browser );
124172
125173 $ ref = new \ReflectionProperty ($ transaction , 'loop ' );
126- $ ref ->setAccessible (true );
174+
175+ if (PHP_VERSION_ID < 80100 ) {
176+ $ ref ->setAccessible (true );
177+ }
127178 $ loop = $ ref ->getValue ($ transaction );
128179
129180 $ this ->assertSame ($ this ->loop , $ loop );
0 commit comments