public function testCreateWithMissingImageSize()
{
$path = $this->getRootDir() . '/images/dummy.jpg';
$framework = $this->getMockBuilder('Contao\\CoreBundle\\Framework\\ContaoFramework')->disableOriginalConstructor()->getMock();
$imageSizeAdapter = $this->getMockBuilder('Contao\\CoreBundle\\Framework\\Adapter')->disableOriginalConstructor()->getMock();
$imageSizeAdapter->expects($this->any())->method('__call')->willReturn(null);
$filesAdapter = $this->getMockBuilder('Contao\\CoreBundle\\Framework\\Adapter')->disableOriginalConstructor()->getMock();
$filesAdapter->expects($this->any())->method('__call')->willReturn(null);
$framework->expects($this->any())->method('getAdapter')->will($this->returnCallback(function ($key) use($imageSizeAdapter, $filesAdapter) {
return ['Contao\\ImageSizeModel' => $imageSizeAdapter, 'Contao\\FilesModel' => $filesAdapter][$key];
}));
$imageFactory = $this->createImageFactory(null, null, null, null, $framework);
$image = $imageFactory->create($path, 1);
$this->assertEquals($path, $image->getPath());
}