@@ -26,9 +26,20 @@ final class BaseResultTest extends CIUnitTestCase
2626 /**
2727 * Create a minimal concrete implementation of BaseResult for testing.
2828 */
29+ /**
30+ * Create a minimal concrete implementation of BaseResult for testing.
31+ *
32+ * @param list<array<string,mixed>> $resultArray Result set as arrays.
33+ * @param list<object> $resultObject Result set as objects.
34+ */
2935 private function createResultDouble (array $ resultArray , array $ resultObject ): BaseResult
3036 {
3137 return new class ($ resultArray , $ resultObject ) extends BaseResult {
38+
39+ /**
40+ * @param list<array<string,mixed>> $resultArray Result set as arrays.
41+ * @param list<object> $resultObject Result set as objects.
42+ */
3243 public function __construct (array $ resultArray , array $ resultObject )
3344 {
3445 $ this ->resultArray = $ resultArray ;
@@ -45,11 +56,17 @@ public function getFieldCount(): int
4556 return 0 ;
4657 }
4758
59+ /**
60+ * @return list<string>
61+ */
4862 public function getFieldNames (): array
4963 {
5064 return [];
5165 }
5266
67+ /**
68+ * @return list<object>
69+ */
5370 public function getFieldData (): array
5471 {
5572 return [];
@@ -64,6 +81,9 @@ public function dataSeek(int $n = 0): bool
6481 return true ;
6582 }
6683
84+ /**
85+ * @return list<array<string,mixed>>|false|null
86+ */
6787 protected function fetchAssoc ()
6888 {
6989 return false ;
@@ -129,8 +149,8 @@ public function testGetRowObjectReturnsObject(): void
129149
130150 $ result = $ this ->createResultDouble ([], [$ row1 , $ row2 ]);
131151
132- $ this ->assertEquals ($ row1 , $ result ->getRowObject (0 ));
133- $ this ->assertEquals ($ row2 , $ result ->getRowObject (1 ));
152+ $ this ->assertSame ($ row1 , $ result ->getRowObject (0 ));
153+ $ this ->assertSame ($ row2 , $ result ->getRowObject (1 ));
134154 }
135155
136156 public function testGetRowObjectReturnsNullForEmptyResult (): void
@@ -148,7 +168,7 @@ public function testGetRowObjectReturnsFirstRowByDefault(): void
148168
149169 $ result = $ this ->createResultDouble ([], [$ row1 ]);
150170
151- $ this ->assertEquals ($ row1 , $ result ->getRowObject ());
171+ $ this ->assertSame ($ row1 , $ result ->getRowObject ());
152172 }
153173
154174 public function testGetRowObjectAndGetRowArrayShareCurrentRow (): void
@@ -193,7 +213,7 @@ public function testGetRowObjectUsesCurrentRowLikeGetRowArray(): void
193213 // Both methods should advance currentRow consistently
194214 $ result ->getRowObject (1 );
195215 $ result ->getRowArray ();
196- $ this ->assertEquals ($ row1 , $ result ->getRowObject ());
216+ $ this ->assertSame ($ row1 , $ result ->getRowObject ());
197217 }
198218
199219 // --------------------------------------------------------------------
@@ -218,7 +238,7 @@ public function testGetRowObjectWithInvalidIndexReturnsFirstRow(): void
218238
219239 $ result = $ this ->createResultDouble ([], [$ row1 ]);
220240
221- $ this ->assertEquals ($ row1 , $ result ->getRow (999 , 'object ' ));
241+ $ this ->assertSame ($ row1 , $ result ->getRow (999 , 'object ' ));
222242 }
223243
224244 public function testGetRowNullForColumnNameNotFound (): void
@@ -244,7 +264,7 @@ public function testGetCustomRowObjectReturnsNullForOutOfBounds(): void
244264 $ result = $ this ->createResultDouble ([], [$ row ]);
245265 $ result ->getCustomResultObject (stdClass::class);
246266
247- $ this ->assertEquals ( $ row , $ result ->getCustomRowObject (999 , stdClass::class));
267+ $ this ->assertNotInstanceOf (stdClass::class , $ result ->getCustomRowObject (999 , stdClass::class));
248268 }
249269
250270 // --------------------------------------------------------------------
@@ -291,7 +311,7 @@ public function testGetCustomRowObjectReturnsNullWhenCurrentRowIsInvalid(): void
291311
292312 $ result ->currentRow = 999 ;
293313
294- $ this ->assertNull ( $ result ->getCustomRowObject (0 , stdClass::class));
314+ $ this ->assertNotInstanceOf (stdClass::class, $ result ->getCustomRowObject (0 , stdClass::class));
295315 }
296316
297317 public function testGetPreviousRowReturnsNullWhenCurrentRowIsInvalid (): void
0 commit comments