ConnectionTest::testQueryFetchRow PHP Method

testQueryFetchRow() public method

public testQueryFetchRow ( )
    function testQueryFetchRow()
    {
        \Amp\reactor(\Amp\driver());
        \Amp\run(function () {
            $db = new Connection("host=" . DB_HOST . ";user=" . DB_USER . ";pass=" . DB_PASS . ";db=connectiontest");
            $db->connect();
            $db->query('DROP TABLE tmp');
            $db->query('CREATE TABLE tmp (a int)');
            $db->query('INSERT INTO tmp VALUES (1), (2), (3)');
            $resultset = (yield $db->query('SELECT a FROM tmp'));
            $got = [];
            while ($row = (yield $resultset->fetchRow())) {
                $got[] = $row;
            }
            $this->assertEquals($got, [[1], [2], [3]]);
        });
    }