Пример #1
0
 protected function setUp()
 {
     if (!self::$_isStubClass) {
         $this->getMockForAbstractClass('Magento\\Catalog\\Block\\Product\\AbstractProduct', [], self::STUB_CLASS, false);
         self::$_isStubClass = true;
     }
     \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\App\\State')->setAreaCode('frontend');
     \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\View\\DesignInterface')->setDefaultDesignTheme();
     $this->_block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\View\\LayoutInterface')->createBlock(self::STUB_CLASS);
     $this->_product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Catalog\\Model\\Product');
     $this->_product->load(1);
     $this->_product->addData(['image' => '/m/a/magento_image.jpg', 'small_image' => '/m/a/magento_image.jpg', 'thumbnail' => '/m/a/magento_image.jpg']);
     $this->_block->setProduct($this->_product);
 }