From 8a2ccf96add57c948236667664e6f8e9107e52bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Kucha=C5=99?= <honza.kuchar@grifart.cz>
Date: Thu, 12 May 2016 12:16:39 +0200
Subject: [PATCH] ICursorTest: added test for fetchOneAt(<negative>)

---
 tests/Store/PostgresDriver/ICursorTest.php | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/Store/PostgresDriver/ICursorTest.php b/tests/Store/PostgresDriver/ICursorTest.php
index a022e02..7c4923e 100644
--- a/tests/Store/PostgresDriver/ICursorTest.php
+++ b/tests/Store/PostgresDriver/ICursorTest.php
@@ -218,6 +218,14 @@ abstract class ICursorTest extends BaseTest
 		Assert::same(5, $data["n"]);
 	}
 
+	public function test_givenInitialPosition_whenFetchMinus2_thenGetSecondFromRight()
+	{
+		$this->uut->moveTo(234); // wherever
+
+		$data = $this->uut->fetchOneAt(-2);
+		Assert::same(999, $data["n"]);
+	}
+
 
 	// fetchOneBy()
 	public function test_givenInitialPosition_whenFetchCurrent_thenGetNull()
-- 
GitLab