Working state
This commit is contained in:
@@ -211,7 +211,7 @@ final class MediaServiceTest extends TestCase
|
||||
private function makeUploadedFile(int $size): UploadedFileInterface
|
||||
{
|
||||
$stream = $this->createMock(StreamInterface::class);
|
||||
$stream->method('getMetadata')->willReturnMap([['uri', '/nonexistent/path']]);
|
||||
$stream->method('getMetadata')->willReturnCallback(static fn (?string $key = null): mixed => $key === 'uri' ? '/nonexistent/path' : null);
|
||||
|
||||
$file = $this->createMock(UploadedFileInterface::class);
|
||||
$file->method('getSize')->willReturn($size);
|
||||
@@ -227,7 +227,7 @@ final class MediaServiceTest extends TestCase
|
||||
private function makeUploadedFileFromPath(string $path, int $size): UploadedFileInterface
|
||||
{
|
||||
$stream = $this->createMock(StreamInterface::class);
|
||||
$stream->method('getMetadata')->willReturnMap([['uri', $path]]);
|
||||
$stream->expects($this->once())->method('getMetadata')->with('uri')->willReturn($path);
|
||||
|
||||
$file = $this->createMock(UploadedFileInterface::class);
|
||||
$file->method('getSize')->willReturn($size);
|
||||
|
||||
Reference in New Issue
Block a user