@@ -22,7 +22,9 @@ public function setUpBrowser()
2222 $ this ->browser = new Browser (null , $ this ->loop );
2323
2424 $ ref = new \ReflectionProperty ($ this ->browser , 'transaction ' );
25- $ ref ->setAccessible (true );
25+ if (PHP_VERSION_ID < 80100 ) {
26+ $ ref ->setAccessible (true );
27+ }
2628 $ ref ->setValue ($ this ->browser , $ this ->sender );
2729 }
2830
@@ -31,11 +33,15 @@ public function testConstructWithoutLoopAssignsLoopAutomatically()
3133 $ browser = new Browser ();
3234
3335 $ ref = new \ReflectionProperty ($ browser , 'transaction ' );
34- $ ref ->setAccessible (true );
36+ if (PHP_VERSION_ID < 80100 ) {
37+ $ ref ->setAccessible (true );
38+ }
3539 $ transaction = $ ref ->getValue ($ browser );
3640
3741 $ ref = new \ReflectionProperty ($ transaction , 'loop ' );
38- $ ref ->setAccessible (true );
42+ if (PHP_VERSION_ID < 80100 ) {
43+ $ ref ->setAccessible (true );
44+ }
3945 $ loop = $ ref ->getValue ($ transaction );
4046
4147 $ this ->assertInstanceOf ('React\EventLoop\LoopInterface ' , $ loop );
@@ -48,23 +54,33 @@ public function testConstructWithConnectorAssignsGivenConnector()
4854 $ browser = new Browser ($ connector );
4955
5056 $ ref = new \ReflectionProperty ($ browser , 'transaction ' );
51- $ ref ->setAccessible (true );
57+ if (PHP_VERSION_ID < 80100 ) {
58+ $ ref ->setAccessible (true );
59+ }
5260 $ transaction = $ ref ->getValue ($ browser );
5361
5462 $ ref = new \ReflectionProperty ($ transaction , 'sender ' );
55- $ ref ->setAccessible (true );
63+ if (PHP_VERSION_ID < 80100 ) {
64+ $ ref ->setAccessible (true );
65+ }
5666 $ sender = $ ref ->getValue ($ transaction );
5767
5868 $ ref = new \ReflectionProperty ($ sender , 'http ' );
59- $ ref ->setAccessible (true );
69+ if (PHP_VERSION_ID < 80100 ) {
70+ $ ref ->setAccessible (true );
71+ }
6072 $ client = $ ref ->getValue ($ sender );
6173
6274 $ ref = new \ReflectionProperty ($ client , 'connectionManager ' );
63- $ ref ->setAccessible (true );
75+ if (PHP_VERSION_ID < 80100 ) {
76+ $ ref ->setAccessible (true );
77+ }
6478 $ connectionManager = $ ref ->getValue ($ client );
6579
6680 $ ref = new \ReflectionProperty ($ connectionManager , 'connector ' );
67- $ ref ->setAccessible (true );
81+ if (PHP_VERSION_ID < 80100 ) {
82+ $ ref ->setAccessible (true );
83+ }
6884 $ ret = $ ref ->getValue ($ connectionManager );
6985
7086 $ this ->assertSame ($ connector , $ ret );
@@ -77,23 +93,33 @@ public function testConstructWithConnectorWithLegacySignatureAssignsGivenConnect
7793 $ browser = new Browser (null , $ connector );
7894
7995 $ ref = new \ReflectionProperty ($ browser , 'transaction ' );
80- $ ref ->setAccessible (true );
96+ if (PHP_VERSION_ID < 80100 ) {
97+ $ ref ->setAccessible (true );
98+ }
8199 $ transaction = $ ref ->getValue ($ browser );
82100
83101 $ ref = new \ReflectionProperty ($ transaction , 'sender ' );
84- $ ref ->setAccessible (true );
102+ if (PHP_VERSION_ID < 80100 ) {
103+ $ ref ->setAccessible (true );
104+ }
85105 $ sender = $ ref ->getValue ($ transaction );
86106
87107 $ ref = new \ReflectionProperty ($ sender , 'http ' );
88- $ ref ->setAccessible (true );
108+ if (PHP_VERSION_ID < 80100 ) {
109+ $ ref ->setAccessible (true );
110+ }
89111 $ client = $ ref ->getValue ($ sender );
90112
91113 $ ref = new \ReflectionProperty ($ client , 'connectionManager ' );
92- $ ref ->setAccessible (true );
114+ if (PHP_VERSION_ID < 80100 ) {
115+ $ ref ->setAccessible (true );
116+ }
93117 $ connectionManager = $ ref ->getValue ($ client );
94118
95119 $ ref = new \ReflectionProperty ($ connectionManager , 'connector ' );
96- $ ref ->setAccessible (true );
120+ if (PHP_VERSION_ID < 80100 ) {
121+ $ ref ->setAccessible (true );
122+ }
97123 $ ret = $ ref ->getValue ($ connectionManager );
98124
99125 $ this ->assertSame ($ connector , $ ret );
@@ -104,11 +130,15 @@ public function testConstructWithLoopAssignsGivenLoop()
104130 $ browser = new Browser (null , $ this ->loop );
105131
106132 $ ref = new \ReflectionProperty ($ browser , 'transaction ' );
107- $ ref ->setAccessible (true );
133+ if (PHP_VERSION_ID < 80100 ) {
134+ $ ref ->setAccessible (true );
135+ }
108136 $ transaction = $ ref ->getValue ($ browser );
109137
110138 $ ref = new \ReflectionProperty ($ transaction , 'loop ' );
111- $ ref ->setAccessible (true );
139+ if (PHP_VERSION_ID < 80100 ) {
140+ $ ref ->setAccessible (true );
141+ }
112142 $ loop = $ ref ->getValue ($ transaction );
113143
114144 $ this ->assertSame ($ this ->loop , $ loop );
@@ -119,11 +149,15 @@ public function testConstructWithLoopWithLegacySignatureAssignsGivenLoop()
119149 $ browser = new Browser ($ this ->loop );
120150
121151 $ ref = new \ReflectionProperty ($ browser , 'transaction ' );
122- $ ref ->setAccessible (true );
152+ if (PHP_VERSION_ID < 80100 ) {
153+ $ ref ->setAccessible (true );
154+ }
123155 $ transaction = $ ref ->getValue ($ browser );
124156
125157 $ ref = new \ReflectionProperty ($ transaction , 'loop ' );
126- $ ref ->setAccessible (true );
158+ if (PHP_VERSION_ID < 80100 ) {
159+ $ ref ->setAccessible (true );
160+ }
127161 $ loop = $ ref ->getValue ($ transaction );
128162
129163 $ this ->assertSame ($ this ->loop , $ loop );
0 commit comments