| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | public function testPrepareWithSvg() |
||
| 17 | { |
||
| 18 | $mockMimeTypeGuesserfactory = $this->createMock(MimeTypeGuesserFactoryInterface::class); |
||
| 19 | $mockExtensionGuesserfactory = $this->createMock(ExtensionGuesserFactoryInterface::class); |
||
| 20 | |||
| 21 | $mockMimeTypeGuesserfactory->method('get')->willReturn(MimeTypeGuesser::getInstance()); |
||
| 22 | |||
| 23 | $handler = new ImageHandler(1, $mockMimeTypeGuesserfactory, $mockExtensionGuesserfactory, 'aviaryKey'); |
||
| 24 | $handler->setSlugifier(new Slugifier()); |
||
| 25 | |||
| 26 | $media = new Media(); |
||
| 27 | $media->setContent(new File(__DIR__.'/../../Fixtures/sample.svg')); |
||
| 28 | |||
| 29 | $handler->prepareMedia($media); |
||
| 30 | |||
| 31 | $this->assertSame(['original_width' => null, 'original_height' => null], $media->getMetadata()); |
||
| 32 | } |
||
| 33 | } |
||
| 34 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: