Skip to content

Commit 94d99b1

Browse files
committed
Test Result::fetch{Row,ArrayRow} methods
1 parent 229ea27 commit 94d99b1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/ResultTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ public function testFetchRow() : void
9494
$result = static::$database->query('SELECT * FROM `t1`');
9595
self::assertSame(1, $result->fetchRow(0)->c1);
9696
self::assertSame(4, $result->fetchRow(3)->c1);
97+
$this->expectException(\OutOfRangeException::class);
98+
$this->expectExceptionMessage('Invalid cursor offset: 5');
99+
$result->fetchRow(5);
97100
}
98101

99102
public function testFetchRowFree() : void
@@ -106,6 +109,9 @@ public function testFetchArrayRow() : void
106109
$result = static::$database->query('SELECT * FROM `t1`');
107110
self::assertSame(1, $result->fetchArrayRow(0)['c1']);
108111
self::assertSame(4, $result->fetchArrayRow(3)['c1']);
112+
$this->expectException(\OutOfRangeException::class);
113+
$this->expectExceptionMessage('Invalid cursor offset: 5');
114+
$result->fetchArrayRow(5);
109115
}
110116

111117
public function testFetchArrayRowFree() : void

0 commit comments

Comments
 (0)