fix test
authorMichael Wallner <mike@php.net>
Fri, 22 Feb 2013 11:14:00 +0000 (12:14 +0100)
committerMichael Wallner <mike@php.net>
Fri, 22 Feb 2013 11:21:50 +0000 (12:21 +0100)
tests/unbuffered001.phpt

index 0754d8a767af4fb6802905de5946a147e1965b4b..a009b632426be37d1d36b35adb579693fca957cd 100644 (file)
@@ -26,22 +26,17 @@ $c->execAsync("SELECT a from generate_series(1,10) a", function($res) {
                break;
        }
 });
+
 do {
        while ($c->busy) {
-               switch ($c->poll()) {
-                       case pq\Connection::POLLING_READING:
-                               $w=$e=array();
-                               $r=array($c->socket);
-                               stream:select($r,$w,$e,1);
-                               break;
-                       case pq\Connection::POLLING_WRITING:
-                               $r=$e=array();
-                               $w=array($c->socket);
-                               stream_select($r,$w,$e,1);
-                               break;
+               $r = array($c->socket);
+               $w = $e = null;
+               if (stream_select($r, $w, $e, null)) {
+                       $c->poll();
                }
        }
 } while ($c->getResult());
+
 ?>
 DONE
 --EXPECTF--