Skip to content
Snippets Groups Projects
Commit 9c310ec0 authored by Jan Kuchař's avatar Jan Kuchař
Browse files

tests: added moveTo edge cases

parent 277c8e3f
Branches
No related tags found
No related merge requests found
...@@ -268,4 +268,20 @@ abstract class CursorInterfaceTest extends BaseTest ...@@ -268,4 +268,20 @@ abstract class CursorInterfaceTest extends BaseTest
}, CursorException::class, CursorException::MESSAGE_NO_DATA_TO_FETCH); }, CursorException::class, CursorException::MESSAGE_NO_DATA_TO_FETCH);
} }
public function test_giveSomePosition_whenMoveToAfterEnd_thenGetError()
{
$this->uut->moveTo(1000);
Assert::exception(function() {
$this->uut->moveTo(1001);
}, CursorException::class, CursorException::MESSAGE_OVERFLOW);
}
public function test_giveSomePosition_whenMoveToBeforeBeginning_thenGetError()
{
$this->uut->moveTo(1);
Assert::exception(function() {
$this->uut->moveTo(0);
}, CursorException::class, CursorException::MESSAGE_OVERFLOW);
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment