11<?php
22
3+ namespace Clue \Tests \React \EventSource ;
4+
35use PHPUnit \Framework \TestCase ;
46use Clue \React \EventSource \EventSource ;
57use React \Promise \Promise ;
@@ -44,7 +46,7 @@ public function testConstructorCanBeCalledWithoutBrowser()
4446
4547 $ es = new EventSource ('http://example.invalid ' , $ loop );
4648
47- $ ref = new ReflectionProperty ($ es , 'browser ' );
49+ $ ref = new \ ReflectionProperty ($ es , 'browser ' );
4850 $ ref ->setAccessible (true );
4951 $ browser = $ ref ->getValue ($ es );
5052
@@ -98,7 +100,7 @@ public function testCloseWillNotEmitErrorEventWhenGetRequestCancellationHandlerR
98100 $ loop = $ this ->getMockBuilder ('React\EventLoop\LoopInterface ' )->getMock ();
99101
100102 $ pending = new Promise (function () { }, function () {
101- throw new RuntimeException ();
103+ throw new \ RuntimeException ();
102104 });
103105 $ browser = $ this ->getMockBuilder ('Clue\React\Buzz\Browser ' )->disableOriginalConstructor ()->getMock ();
104106 $ browser ->expects ($ this ->once ())->method ('withOptions ' )->willReturnSelf ();
@@ -131,7 +133,7 @@ public function testConstructorWillStartGetRequestThatWillStartRetryTimerWhenGet
131133
132134 $ es = new EventSource ('http://example.com ' , $ loop , $ browser );
133135
134- $ deferred ->reject (new RuntimeException ());
136+ $ deferred ->reject (new \ RuntimeException ());
135137 }
136138
137139 public function testConstructorWillStartGetRequestThatWillStartRetryTimerThatWillRetryGetRequestWhenInitialGetRequestRejects ()
@@ -156,7 +158,7 @@ public function testConstructorWillStartGetRequestThatWillStartRetryTimerThatWil
156158
157159 $ es = new EventSource ('http://example.com ' , $ loop , $ browser );
158160
159- $ deferred ->reject (new RuntimeException ());
161+ $ deferred ->reject (new \ RuntimeException ());
160162
161163 $ this ->assertNotNull ($ timerRetry );
162164 $ timerRetry ();
@@ -181,7 +183,7 @@ public function testConstructorWillStartGetRequestThatWillEmitErrorWhenGetReques
181183 $ es ->on ('error ' , function ($ e ) use (&$ caught ) {
182184 $ caught = $ e ;
183185 });
184- $ deferred ->reject ($ expected = new RuntimeException ());
186+ $ deferred ->reject ($ expected = new \ RuntimeException ());
185187
186188 $ this ->assertSame ($ expected , $ caught );
187189 }
@@ -200,7 +202,7 @@ public function testConstructorWillStartGetRequestThatWillNotStartRetryTimerWhen
200202 $ es ->on ('error ' , function () use ($ es ) {
201203 $ es ->close ();
202204 });
203- $ deferred ->reject (new RuntimeException ());
205+ $ deferred ->reject (new \ RuntimeException ());
204206 }
205207
206208 public function testCloseAfterGetRequestFromConstructorFailsWillCancelPendingRetryTimer ()
@@ -220,7 +222,7 @@ public function testCloseAfterGetRequestFromConstructorFailsWillCancelPendingRet
220222
221223 $ es = new EventSource ('http://example.com ' , $ loop , $ browser );
222224
223- $ deferred ->reject (new RuntimeException ());
225+ $ deferred ->reject (new \ RuntimeException ());
224226
225227 $ es ->close ();
226228 }
0 commit comments