Skip to content

Commit 76af954

Browse files
committed
bug #1189 [Platform] Fix exception message thrown in File::fromDataUrl method (hhamon)
This PR was merged into the main branch. Discussion ---------- [Platform] Fix exception message thrown in `File::fromDataUrl` method | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | Docs? | no | Issues | ~ | License | MIT Commits ------- e90678c [Platform] Fix exception message thrown in `File::fromDataUrl` method
2 parents cc4bb09 + e90678c commit 76af954

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/platform/src/Message/Content/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final public function __construct(
3131
public static function fromDataUrl(string $dataUrl): static
3232
{
3333
if (!str_starts_with($dataUrl, 'data:')) {
34-
throw new InvalidArgumentException('Invalid audio data URL format.');
34+
throw new InvalidArgumentException('Invalid file data URL format.');
3535
}
3636

3737
return new static(

src/platform/tests/Message/Content/AudioTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testFromDataUrlWithValidUrl()
3636
public function testFromDataUrlWithInvalidUrl()
3737
{
3838
$this->expectException(\InvalidArgumentException::class);
39-
$this->expectExceptionMessage('Invalid audio data URL format.');
39+
$this->expectExceptionMessage('Invalid file data URL format.');
4040

4141
Audio::fromDataUrl('invalid-url');
4242
}

src/platform/tests/Message/Content/BinaryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testCreateFromDataUrl()
3232
public function testThrowsExceptionForInvalidDataUrl()
3333
{
3434
$this->expectException(InvalidArgumentException::class);
35-
$this->expectExceptionMessage('Invalid audio data URL format.');
35+
$this->expectExceptionMessage('Invalid file data URL format.');
3636

3737
File::fromDataUrl('invalid-data-url');
3838
}

0 commit comments

Comments
 (0)