Skip to content

Commit 731b1da

Browse files
committed
test: Fit test to new behavior
1 parent c38791b commit 731b1da

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

tests/Unit/DTO/Type/ArrayType/ArrayTestCase.php

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,11 @@ public function testUnmarshalling(): void
7676

7777
public function testSetNullToNotNullable(): void
7878
{
79-
try {
80-
$this->unmarshal([
81-
'foo' => null,
82-
], new ArrayDto());
79+
$dto = $this->unmarshal([
80+
'foo' => null,
81+
], new ArrayDto());
8382

84-
$this->fail('Null value should not be allowed.');
85-
} catch (\Throwable $e) {
86-
$this->assertStringContainsString(
87-
'`foo`',
88-
$e->getMessage(),
89-
);
90-
$this->assertInstanceOf(\InvalidArgumentException::class, $e->getPrevious());
91-
$this->assertStringContainsString(
92-
'Passed value must be a type of array, but null given',
93-
$e->getPrevious()->getMessage(),
94-
);
95-
}
83+
self::assertSame([], $dto->foo);
9684
}
9785

9886
protected function getTypeMatchers(): array

0 commit comments

Comments
 (0)