public function provideImage() { Image::setConfig(realpath(__DIR__ . '/../../' . self::CONFIG)); // build File mock $file = $this->getMockBuilder('\\Webiny\\Component\\Storage\\File\\File')->disableOriginalConstructor()->setMethods(['getAbsolutePath', 'getKey'])->getMock(); // getAbsolutePath mock $file->expects($this->any())->method('getAbsolutePath')->will($this->returnValue(__DIR__ . '/../../image.gif')); // getKey mock $file->expects($this->once())->method('getKey')->will($this->returnValue(__DIR__ . '/../../image.gif')); $image = ImageLoader::open($file); return [[$image]]; }
public function setUp() { Image::setConfig(realpath(__DIR__ . self::CONFIG)); }