Skip to content

Commit 1a9ecdd

Browse files
committed
clean up
1 parent 24f7b50 commit 1a9ecdd

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

tests/FinderTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,17 +261,14 @@ public static function lastReturnKeyResortKeyDataProvider(): array
261261

262262
public function testLastKeepCurrentOriginalData(): void
263263
{
264-
$obj = new stdClass();
265-
$obj->data = new ArrayIterator([new DateTime('now'), new DateTimeImmutable('now'), new stdClass()]);
264+
$data = [new DateTime('now'), new DateTimeImmutable('now'), new stdClass()];
266265

267266
// get last
268-
$last = Finder::last($obj->data, static fn(object $datum): bool => $datum instanceof DateTimeInterface);
267+
$last = Finder::last($data, static fn(object $datum): bool => $datum instanceof DateTimeInterface);
269268
$this->assertInstanceOf(DateTimeImmutable::class, $last);
270269

271270
// keep first record not changed from data
272-
$this->assertInstanceOf(DateTime::class, $obj->data[0]);
273-
$arrayCopy = $obj->data->getArrayCopy();
274-
$this->assertSame(DateTime::class, current($arrayCopy)::class);
271+
$this->assertSame(DateTime::class, current($data)::class);
275272
}
276273

277274
#[DataProvider('rowsDataProvider')]

0 commit comments

Comments
 (0)