From 9c310ec0273f176b04cffca77e31f0d0aa7e9509 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Kucha=C5=99?= <honza.kuchar@grifart.cz>
Date: Fri, 6 May 2016 21:35:24 +0200
Subject: [PATCH] tests: added moveTo edge cases

---
 .../Store/PostgresDriver/CursorInterfaceTest.php | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/tests/Store/PostgresDriver/CursorInterfaceTest.php b/tests/Store/PostgresDriver/CursorInterfaceTest.php
index 4e83ebe..7aa7872 100644
--- a/tests/Store/PostgresDriver/CursorInterfaceTest.php
+++ b/tests/Store/PostgresDriver/CursorInterfaceTest.php
@@ -268,4 +268,20 @@ abstract class CursorInterfaceTest extends BaseTest
 		}, 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);
+	}
+
 }
-- 
GitLab