Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland committed Jan 9, 2024
1 parent 143843a commit 591f79e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion framework/core/src/User/Command/RegisterUserHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private function uploadAvatarFromUrl(User $user, string $url): void
'url' => 'required|active_url',
]);

if ($urlValidator->fails() || $urlContents = $this->retrieveAvatarFromUrl($url) === null) {
if ($urlValidator->fails()) {
throw new InvalidArgumentException('Provided avatar URL must be a valid URI.', 503);
}

Expand All @@ -136,6 +136,8 @@ private function uploadAvatarFromUrl(User $user, string $url): void
throw new InvalidArgumentException("Provided avatar URL must have scheme http or https. Scheme provided was $scheme.", 503);
}

$urlContents = $this->retrieveAvatarFromUrl($url);

if ($urlContents !== null) {
$image = $this->imageManager->read($urlContents);

Expand All @@ -145,6 +147,7 @@ private function uploadAvatarFromUrl(User $user, string $url): void

private function retrieveAvatarFromUrl(string $url): ?string
{
print_r($url);
$client = new Client();

try {
Expand Down

0 comments on commit 591f79e

Please sign in to comment.