Fix phpunit deprecation warnings (#8)

This commit is contained in:
Daniel Siepmann 2023-04-03 11:35:47 +02:00 committed by GitHub
parent a49ba7c4d2
commit afd8c59c9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -31,7 +31,8 @@ Fixes
Tasks Tasks
----- -----
Nothing * Solve PHPUnit deprecation: "Passing an argument of type Generator for the $haystack parameter is deprecated. Support for this will be removed in PHPUnit 10."
Migrate iterator to array within tests.
Deprecation Deprecation
----------- -----------

View file

@ -56,7 +56,7 @@ class DatesFactoryTest extends TestCase
$result = $subject->createDates($unkownInput, false); $result = $subject->createDates($unkownInput, false);
self::assertInstanceOf(\Generator::class, $result); self::assertInstanceOf(\Generator::class, $result);
self::assertCount(0, $result); self::assertCount(0, iterator_to_array($result));
} }
public function possibleUnkownInput(): array public function possibleUnkownInput(): array
@ -92,7 +92,7 @@ class DatesFactoryTest extends TestCase
$firstEntry = $result->current(); $firstEntry = $result->current();
self::assertCount(1, $result); self::assertCount(1, iterator_to_array($result));
self::assertInstanceOf(Date::class, $firstEntry); self::assertInstanceOf(Date::class, $firstEntry);
self::assertSame(1648821600, $firstEntry->getStart()->getTimestamp()); self::assertSame(1648821600, $firstEntry->getStart()->getTimestamp());
@ -143,7 +143,7 @@ class DatesFactoryTest extends TestCase
$firstEntry = $result->current(); $firstEntry = $result->current();
self::assertCount(1, $result); self::assertCount(1, iterator_to_array($result));
self::assertInstanceOf(Date::class, $firstEntry); self::assertInstanceOf(Date::class, $firstEntry);
self::assertSame(1648821600, $firstEntry->getStart()->getTimestamp()); self::assertSame(1648821600, $firstEntry->getStart()->getTimestamp());