protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->testData = ['before_element_html' => 'test_before_element_html', 'html_id' => 'test_id', 'name' => 'test_name', 'value' => 'test_value', 'title' => 'test_title', 'disabled' => true, 'after_element_js' => 'test_after_element_js', 'after_element_html' => 'test_after_element_html', 'html_id_prefix' => 'test_id_prefix_', 'html_id_suffix' => '_test_id_suffix']; $this->file = $objectManager->getObject('Magento\\Config\\Block\\System\\Config\\Form\\Field\\File', ['data' => $this->testData]); $formMock = new \Magento\Framework\DataObject(); $formMock->setHtmlIdPrefix($this->testData['html_id_prefix']); $formMock->setHtmlIdSuffix($this->testData['html_id_suffix']); $this->file->setForm($formMock); }
protected function setUp() { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->urlBuilderMock = $this->getMock('Magento\\Framework\\Url', [], [], '', false); $this->image = $objectManager->getObject('Magento\\Config\\Block\\System\\Config\\Form\\Field\\Image', ['urlBuilder' => $this->urlBuilderMock]); $this->testData = ['html_id_prefix' => 'test_id_prefix_', 'html_id' => 'test_id', 'html_id_suffix' => '_test_id_suffix', 'path' => 'catalog/product/placeholder', 'value' => 'test_value']; $formMock = new \Magento\Framework\DataObject(); $formMock->setHtmlIdPrefix($this->testData['html_id_prefix']); $formMock->setHtmlIdSuffix($this->testData['html_id_suffix']); $this->image->setForm($formMock); }