11<?php
22
3+ namespace Clue \Tests \React \SQLite ;
4+
35use Clue \React \SQLite \DatabaseInterface ;
46use Clue \React \SQLite \Factory ;
57use Clue \React \SQLite \Result ;
@@ -22,10 +24,10 @@ public function provideSocketFlags()
2224 */
2325 public function testOpenMemoryDatabaseResolvesWithDatabaseAndRunsUntilClose ($ flag )
2426 {
25- $ loop = React \EventLoop \Factory::create ();
27+ $ loop = \ React \EventLoop \Factory::create ();
2628 $ factory = new Factory ($ loop );
2729
28- $ ref = new ReflectionProperty ($ factory , 'useSocket ' );
30+ $ ref = new \ ReflectionProperty ($ factory , 'useSocket ' );
2931 $ ref ->setAccessible (true );
3032 $ ref ->setValue ($ factory , $ flag );
3133
@@ -48,10 +50,10 @@ public function testOpenMemoryDatabaseResolvesWithDatabaseAndRunsUntilClose($fla
4850 */
4951 public function testOpenMemoryDatabaseResolvesWithDatabaseAndRunsUntilQuit ($ flag )
5052 {
51- $ loop = React \EventLoop \Factory::create ();
53+ $ loop = \ React \EventLoop \Factory::create ();
5254 $ factory = new Factory ($ loop );
5355
54- $ ref = new ReflectionProperty ($ factory , 'useSocket ' );
56+ $ ref = new \ ReflectionProperty ($ factory , 'useSocket ' );
5557 $ ref ->setAccessible (true );
5658 $ ref ->setValue ($ factory , $ flag );
5759
@@ -77,7 +79,7 @@ public function testOpenMemoryDatabaseShouldNotInheritActiveFileDescriptors()
7779 $ this ->markTestSkipped ('Platform does not prevent binding to same address (Windows?) ' );
7880 }
7981
80- $ loop = React \EventLoop \Factory::create ();
82+ $ loop = \ React \EventLoop \Factory::create ();
8183 $ factory = new Factory ($ loop );
8284
8385 $ promise = $ factory ->open (':memory: ' );
@@ -115,10 +117,10 @@ public function testOpenMemoryDatabaseShouldNotInheritActiveFileDescriptors()
115117 */
116118 public function testOpenInvalidPathRejects ($ flag )
117119 {
118- $ loop = React \EventLoop \Factory::create ();
120+ $ loop = \ React \EventLoop \Factory::create ();
119121 $ factory = new Factory ($ loop );
120122
121- $ ref = new ReflectionProperty ($ factory , 'useSocket ' );
123+ $ ref = new \ ReflectionProperty ($ factory , 'useSocket ' );
122124 $ ref ->setAccessible (true );
123125 $ ref ->setValue ($ factory , $ flag );
124126
@@ -138,10 +140,10 @@ public function testOpenInvalidPathRejects($flag)
138140 */
139141 public function testOpenInvalidFlagsRejects ($ flag )
140142 {
141- $ loop = React \EventLoop \Factory::create ();
143+ $ loop = \ React \EventLoop \Factory::create ();
142144 $ factory = new Factory ($ loop );
143145
144- $ ref = new ReflectionProperty ($ factory , 'useSocket ' );
146+ $ ref = new \ ReflectionProperty ($ factory , 'useSocket ' );
145147 $ ref ->setAccessible (true );
146148 $ ref ->setValue ($ factory , $ flag );
147149
@@ -161,10 +163,10 @@ public function testOpenInvalidFlagsRejects($flag)
161163 */
162164 public function testQuitResolvesAndRunsUntilQuit ($ flag )
163165 {
164- $ loop = React \EventLoop \Factory::create ();
166+ $ loop = \ React \EventLoop \Factory::create ();
165167 $ factory = new Factory ($ loop );
166168
167- $ ref = new ReflectionProperty ($ factory , 'useSocket ' );
169+ $ ref = new \ ReflectionProperty ($ factory , 'useSocket ' );
168170 $ ref ->setAccessible (true );
169171 $ ref ->setValue ($ factory , $ flag );
170172
@@ -189,10 +191,10 @@ public function testQuitResolvesAndRunsUntilQuitWhenParentHasManyFileDescriptors
189191 $ servers [] = stream_socket_server ('tcp://127.0.0.1:0 ' );
190192 }
191193
192- $ loop = React \EventLoop \Factory::create ();
194+ $ loop = \ React \EventLoop \Factory::create ();
193195 $ factory = new Factory ($ loop );
194196
195- $ ref = new ReflectionProperty ($ factory , 'useSocket ' );
197+ $ ref = new \ ReflectionProperty ($ factory , 'useSocket ' );
196198 $ ref ->setAccessible (true );
197199 $ ref ->setValue ($ factory , $ flag );
198200
@@ -216,10 +218,10 @@ public function testQuitResolvesAndRunsUntilQuitWhenParentHasManyFileDescriptors
216218 */
217219 public function testQuitTwiceWillRejectSecondCall ($ flag )
218220 {
219- $ loop = React \EventLoop \Factory::create ();
221+ $ loop = \ React \EventLoop \Factory::create ();
220222 $ factory = new Factory ($ loop );
221223
222- $ ref = new ReflectionProperty ($ factory , 'useSocket ' );
224+ $ ref = new \ ReflectionProperty ($ factory , 'useSocket ' );
223225 $ ref ->setAccessible (true );
224226 $ ref ->setValue ($ factory , $ flag );
225227
@@ -240,10 +242,10 @@ public function testQuitTwiceWillRejectSecondCall($flag)
240242 */
241243 public function testQueryIntegerResolvesWithResultWithTypeIntegerAndRunsUntilQuit ($ flag )
242244 {
243- $ loop = React \EventLoop \Factory::create ();
245+ $ loop = \ React \EventLoop \Factory::create ();
244246 $ factory = new Factory ($ loop );
245247
246- $ ref = new ReflectionProperty ($ factory , 'useSocket ' );
248+ $ ref = new \ ReflectionProperty ($ factory , 'useSocket ' );
247249 $ ref ->setAccessible (true );
248250 $ ref ->setValue ($ factory , $ flag );
249251
@@ -269,10 +271,10 @@ public function testQueryIntegerResolvesWithResultWithTypeIntegerAndRunsUntilQui
269271 */
270272 public function testQueryStringResolvesWithResultWithTypeStringAndRunsUntilQuit ($ flag )
271273 {
272- $ loop = React \EventLoop \Factory::create ();
274+ $ loop = \ React \EventLoop \Factory::create ();
273275 $ factory = new Factory ($ loop );
274276
275- $ ref = new ReflectionProperty ($ factory , 'useSocket ' );
277+ $ ref = new \ ReflectionProperty ($ factory , 'useSocket ' );
276278 $ ref ->setAccessible (true );
277279 $ ref ->setValue ($ factory , $ flag );
278280
@@ -298,18 +300,18 @@ public function testQueryStringResolvesWithResultWithTypeStringAndRunsUntilQuit(
298300 */
299301 public function testQueryInvalidTableRejectsWithExceptionAndRunsUntilQuit ($ flag )
300302 {
301- $ loop = React \EventLoop \Factory::create ();
303+ $ loop = \ React \EventLoop \Factory::create ();
302304 $ factory = new Factory ($ loop );
303305
304- $ ref = new ReflectionProperty ($ factory , 'useSocket ' );
306+ $ ref = new \ ReflectionProperty ($ factory , 'useSocket ' );
305307 $ ref ->setAccessible (true );
306308 $ ref ->setValue ($ factory , $ flag );
307309
308310 $ promise = $ factory ->open (':memory: ' );
309311
310312 $ data = null ;
311313 $ promise ->then (function (DatabaseInterface $ db ) use (&$ data ){
312- $ db ->query ('SELECT 1 FROM foo ' )->then ('var_dump ' , function (Exception $ e ) use (&$ data ) {
314+ $ db ->query ('SELECT 1 FROM foo ' )->then ('var_dump ' , function (\ Exception $ e ) use (&$ data ) {
313315 $ data = $ e ->getMessage ();
314316 });
315317
@@ -327,18 +329,18 @@ public function testQueryInvalidTableRejectsWithExceptionAndRunsUntilQuit($flag)
327329 */
328330 public function testQueryInvalidTableWithPlaceholderRejectsWithExceptionAndRunsUntilQuit ($ flag )
329331 {
330- $ loop = React \EventLoop \Factory::create ();
332+ $ loop = \ React \EventLoop \Factory::create ();
331333 $ factory = new Factory ($ loop );
332334
333- $ ref = new ReflectionProperty ($ factory , 'useSocket ' );
335+ $ ref = new \ ReflectionProperty ($ factory , 'useSocket ' );
334336 $ ref ->setAccessible (true );
335337 $ ref ->setValue ($ factory , $ flag );
336338
337339 $ promise = $ factory ->open (':memory: ' );
338340
339341 $ data = null ;
340342 $ promise ->then (function (DatabaseInterface $ db ) use (&$ data ){
341- $ db ->query ('SELECT ? FROM foo ' , [1 ])->then ('var_dump ' , function (Exception $ e ) use (&$ data ) {
343+ $ db ->query ('SELECT ? FROM foo ' , [1 ])->then ('var_dump ' , function (\ Exception $ e ) use (&$ data ) {
342344 $ data = $ e ->getMessage ();
343345 });
344346
@@ -363,7 +365,7 @@ public function provideSqlDataWillBeReturnedWithType()
363365 ['X \'01020300 \'' , "\x01\x02\x03\x00" ],
364366 ['X \'3FF3 \'' , "\x3f\xf3" ]
365367 ],
366- (SQLite3::version ()['versionNumber ' ] < 3023000 ) ? [] : [
368+ (\ SQLite3::version ()['versionNumber ' ] < 3023000 ) ? [] : [
367369 // boolean identifiers exist only as of SQLite 3.23.0 (2018-04-02)
368370 // @link https://www.sqlite.org/lang_expr.html#booleanexpr
369371 ['true ' , 1 ],
@@ -379,7 +381,7 @@ public function provideSqlDataWillBeReturnedWithType()
379381 */
380382 public function testQueryValueInStatementResolvesWithResultWithTypeAndRunsUntilQuit ($ value , $ expected )
381383 {
382- $ loop = React \EventLoop \Factory::create ();
384+ $ loop = \ React \EventLoop \Factory::create ();
383385 $ factory = new Factory ($ loop );
384386
385387 $ promise = $ factory ->open (':memory: ' );
@@ -422,7 +424,7 @@ public function provideDataWillBeReturnedWithType()
422424 */
423425 public function testQueryValuePlaceholderPositionalResolvesWithResultWithExactTypeAndRunsUntilQuit ($ value , $ type )
424426 {
425- $ loop = React \EventLoop \Factory::create ();
427+ $ loop = \ React \EventLoop \Factory::create ();
426428 $ factory = new Factory ($ loop );
427429
428430 $ promise = $ factory ->open (':memory: ' );
@@ -447,7 +449,7 @@ public function testQueryValuePlaceholderPositionalResolvesWithResultWithExactTy
447449 */
448450 public function testQueryValuePlaceholderNamedResolvesWithResultWithExactTypeAndRunsUntilQuit ($ value , $ type )
449451 {
450- $ loop = React \EventLoop \Factory::create ();
452+ $ loop = \ React \EventLoop \Factory::create ();
451453 $ factory = new Factory ($ loop );
452454
453455 $ promise = $ factory ->open (':memory: ' );
@@ -481,7 +483,7 @@ public function provideDataWillBeReturnedWithOtherType()
481483 */
482484 public function testQueryValuePlaceholderPositionalResolvesWithResultWithOtherTypeAndRunsUntilQuit ($ value , $ expected )
483485 {
484- $ loop = React \EventLoop \Factory::create ();
486+ $ loop = \ React \EventLoop \Factory::create ();
485487 $ factory = new Factory ($ loop );
486488
487489 $ promise = $ factory ->open (':memory: ' );
@@ -507,7 +509,7 @@ public function testQueryValuePlaceholderPositionalResolvesWithResultWithOtherTy
507509 */
508510 public function testQueryValuePlaceholderNamedResolvesWithResultWithOtherTypeAndRunsUntilQuit ($ value , $ expected )
509511 {
510- $ loop = React \EventLoop \Factory::create ();
512+ $ loop = \ React \EventLoop \Factory::create ();
511513 $ factory = new Factory ($ loop );
512514
513515 $ promise = $ factory ->open (':memory: ' );
@@ -532,10 +534,10 @@ public function testQueryValuePlaceholderNamedResolvesWithResultWithOtherTypeAnd
532534 */
533535 public function testQueryRejectsWhenQueryIsInvalid ($ flag )
534536 {
535- $ loop = React \EventLoop \Factory::create ();
537+ $ loop = \ React \EventLoop \Factory::create ();
536538 $ factory = new Factory ($ loop );
537539
538- $ ref = new ReflectionProperty ($ factory , 'useSocket ' );
540+ $ ref = new \ ReflectionProperty ($ factory , 'useSocket ' );
539541 $ ref ->setAccessible (true );
540542 $ ref ->setValue ($ factory , $ flag );
541543
@@ -557,10 +559,10 @@ public function testQueryRejectsWhenQueryIsInvalid($flag)
557559 */
558560 public function testQueryRejectsWhenClosedImmediately ($ flag )
559561 {
560- $ loop = React \EventLoop \Factory::create ();
562+ $ loop = \ React \EventLoop \Factory::create ();
561563 $ factory = new Factory ($ loop );
562564
563- $ ref = new ReflectionProperty ($ factory , 'useSocket ' );
565+ $ ref = new \ ReflectionProperty ($ factory , 'useSocket ' );
564566 $ ref ->setAccessible (true );
565567 $ ref ->setValue ($ factory , $ flag );
566568
@@ -582,10 +584,10 @@ public function testQueryRejectsWhenClosedImmediately($flag)
582584 */
583585 public function testExecCreateTableResolvesWithResultWithoutRows ($ flag )
584586 {
585- $ loop = React \EventLoop \Factory::create ();
587+ $ loop = \ React \EventLoop \Factory::create ();
586588 $ factory = new Factory ($ loop );
587589
588- $ ref = new ReflectionProperty ($ factory , 'useSocket ' );
590+ $ ref = new \ ReflectionProperty ($ factory , 'useSocket ' );
589591 $ ref ->setAccessible (true );
590592 $ ref ->setValue ($ factory , $ flag );
591593
@@ -611,10 +613,10 @@ public function testExecCreateTableResolvesWithResultWithoutRows($flag)
611613 */
612614 public function testExecRejectsWhenClosedImmediately ($ flag )
613615 {
614- $ loop = React \EventLoop \Factory::create ();
616+ $ loop = \ React \EventLoop \Factory::create ();
615617 $ factory = new Factory ($ loop );
616618
617- $ ref = new ReflectionProperty ($ factory , 'useSocket ' );
619+ $ ref = new \ ReflectionProperty ($ factory , 'useSocket ' );
618620 $ ref ->setAccessible (true );
619621 $ ref ->setValue ($ factory , $ flag );
620622
@@ -636,10 +638,10 @@ public function testExecRejectsWhenClosedImmediately($flag)
636638 */
637639 public function testExecRejectsWhenAlreadyClosed ($ flag )
638640 {
639- $ loop = React \EventLoop \Factory::create ();
641+ $ loop = \ React \EventLoop \Factory::create ();
640642 $ factory = new Factory ($ loop );
641643
642- $ ref = new ReflectionProperty ($ factory , 'useSocket ' );
644+ $ ref = new \ ReflectionProperty ($ factory , 'useSocket ' );
643645 $ ref ->setAccessible (true );
644646 $ ref ->setValue ($ factory , $ flag );
645647
@@ -660,10 +662,10 @@ public function testExecRejectsWhenAlreadyClosed($flag)
660662 */
661663 public function testQueryInsertResolvesWithEmptyResultSetWithLastInsertIdAndRunsUntilQuit ($ flag )
662664 {
663- $ loop = React \EventLoop \Factory::create ();
665+ $ loop = \ React \EventLoop \Factory::create ();
664666 $ factory = new Factory ($ loop );
665667
666- $ ref = new ReflectionProperty ($ factory , 'useSocket ' );
668+ $ ref = new \ ReflectionProperty ($ factory , 'useSocket ' );
667669 $ ref ->setAccessible (true );
668670 $ ref ->setValue ($ factory , $ flag );
669671
@@ -693,10 +695,10 @@ public function testQueryInsertResolvesWithEmptyResultSetWithLastInsertIdAndRuns
693695 */
694696 public function testQuerySelectEmptyResolvesWithEmptyResultSetWithColumnsAndNoRowsAndRunsUntilQuit ($ flag )
695697 {
696- $ loop = React \EventLoop \Factory::create ();
698+ $ loop = \ React \EventLoop \Factory::create ();
697699 $ factory = new Factory ($ loop );
698700
699- $ ref = new ReflectionProperty ($ factory , 'useSocket ' );
701+ $ ref = new \ ReflectionProperty ($ factory , 'useSocket ' );
700702 $ ref ->setAccessible (true );
701703 $ ref ->setValue ($ factory , $ flag );
702704
0 commit comments