Esempio n. 1
0
 public function testGetThumbnailPath()
 {
     $image = 'image_name.jpg';
     $thumbnailPath = '/' . implode('/', [\Magento\Theme\Model\Wysiwyg\Storage::TYPE_IMAGE, \Magento\Theme\Model\Wysiwyg\Storage::THUMBNAIL_DIRECTORY, $image]);
     $this->customization->expects($this->any())->method('getCustomizationPath')->will($this->returnValue($this->customizationPath));
     $this->directoryWrite->expects($this->any())->method('isExist')->will($this->returnValue(true));
     $this->assertEquals($thumbnailPath, $this->helper->getThumbnailPath($image));
 }
 /**
  * @covers \Magento\Framework\View\Design\Theme\Customization::delete
  */
 public function testDelete()
 {
     $file = $this->getMock('Magento\\Theme\\Model\\Theme\\File', ['__wakeup', 'delete'], [], '', false);
     $file->expects($this->once())->method('delete')->will($this->returnSelf());
     $file->setData(['id' => 1, 'theme_id' => 123, 'file_path' => 'css/custom_file1.css', 'content' => 'css content', 'sort_order' => 1]);
     $this->fileProvider->expects($this->once())->method('getItems')->with($this->theme)->will($this->returnValue([$file]));
     $this->assertInstanceOf('Magento\\Framework\\View\\Design\\Theme\\CustomizationInterface', $this->model->delete([1]));
 }