Skip to content

Commit

Permalink
Merge pull request #5309 from mhsdesign/task/fix-behat-tests-PostalAd…
Browse files Browse the repository at this point in the history
…dress-construct-streetAddress-must-be-string

TASK: Throw `InvalidArgumentException` as `\Throwable` is not caught …
  • Loading branch information
mhsdesign authored Oct 22, 2024
2 parents 339987c + b235af6 commit e04047b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,4 @@ Feature: Create node aggregate with node
| nodeAggregateId | "nody-mc-nodeface" |
| nodeTypeName | "Neos.ContentRepository.Testing:NodeWithInvalidDefaultValue" |
| parentNodeAggregateId | "lady-eleonode-rootford" |
Then the last command should have thrown an exception of type "CallErrorException"
Then the last command should have thrown an exception of type "InvalidArgumentException"
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ private function __construct(
public static function fromArray(array $array): self
{
return new self(
$array['streetAddress'],
$array['postalCode'],
$array['addressLocality'],
$array['addressCountry']
$array['streetAddress'] ?? throw new \InvalidArgumentException('streetAddress is not set.'),
$array['postalCode'] ?? throw new \InvalidArgumentException('postalCode is not set.'),
$array['addressLocality'] ?? throw new \InvalidArgumentException('addressLocality is not set.'),
$array['addressCountry'] ?? throw new \InvalidArgumentException('addressCountry is not set.')
);
}

Expand Down

0 comments on commit e04047b

Please sign in to comment.