Skip to content

Commit a1f7ee7

Browse files
committed
Fixed type issues from PHPUnitUtilTest class
1 parent 3fd3782 commit a1f7ee7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/Unit/Utils/Tests/PHPUnitUtilTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use App\Tests\Utils\StringableArrayObject;
1414
use DateTime;
1515
use DateTimeImmutable;
16+
use Doctrine\ORM\Mapping\FieldMapping;
1617
use Generator;
1718
use LogicException;
1819
use PHPUnit\Framework\Attributes\DataProvider;
@@ -52,7 +53,7 @@ public function testThatGetValidValueForTypeThrowsAnExceptionWithNotKnowType():
5253
$this->expectException(LogicException::class);
5354
$this->expectExceptionMessage('Cannot create valid value for type \'666\'.');
5455

55-
PhpUnitUtil::getValidValueForType('666');
56+
PhpUnitUtil::getValidValueForType('666', null);
5657
}
5758

5859
/**
@@ -62,7 +63,7 @@ public function testThatGetValidValueForTypeThrowsAnExceptionWithNotKnowType():
6263
#[TestDox('Test that `getValidValueForType` method returns `$expected` with `$input` and strict mode `$strict`')]
6364
public function testThatGetValidValueReturnsExpectedValue(mixed $expected, string $input, bool $strict): void
6465
{
65-
$value = PhpUnitUtil::getValidValueForType(PhpUnitUtil::getType($input));
66+
$value = PhpUnitUtil::getValidValueForType(PhpUnitUtil::getType($input), null);
6667

6768
$expected = $expected instanceof StringableArrayObject ? $expected->getArrayCopy() : $expected;
6869

@@ -80,7 +81,7 @@ public function testThatGetValidValueReturnsExpectedValue(mixed $expected, strin
8081
#[TestDox('Test that `getValidValueForType` works as expected with custom type')]
8182
public function testThatGetValidValueForTypeWorksWithCustomType(): void
8283
{
83-
self::assertInstanceOf(User::class, PhpUnitUtil::getValidValueForType(User::class));
84+
self::assertInstanceOf(User::class, PhpUnitUtil::getValidValueForType(User::class, null));
8485
}
8586

8687
/**
@@ -94,7 +95,7 @@ public function testThatGetValidValueForTypeWorksIfThereIsAPipeOnType(
9495
int | string | array $expected,
9596
string $type,
9697
): void {
97-
self::assertSame($expected, PhpUnitUtil::getValidValueForType($type));
98+
self::assertSame($expected, PhpUnitUtil::getValidValueForType($type, null));
9899
}
99100

100101
/**

0 commit comments

Comments
 (0)