Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ImagefileTest.php
Go to the documentation of this file.
1 <?php
11 
12 class ImagefileTest extends \PHPUnit\Framework\TestCase
13 {
18 
22  protected $_imagefile;
23 
24  protected function setUp()
25  {
26  $factoryMock = $this->createMock(\Magento\Framework\Data\Form\Element\Factory::class);
27  $collectionFactoryMock = $this->createMock(\Magento\Framework\Data\Form\Element\CollectionFactory::class);
28  $escaperMock = $this->createMock(\Magento\Framework\Escaper::class);
29  $this->_imagefile = new \Magento\Framework\Data\Form\Element\Imagefile(
30  $factoryMock,
31  $collectionFactoryMock,
32  $escaperMock
33  );
34  }
35 
39  public function testConstruct()
40  {
41  $this->assertEquals('file', $this->_imagefile->getType());
42  $this->assertEquals('imagefile', $this->_imagefile->getExtType());
43  $this->assertFalse($this->_imagefile->getAutosubmit());
44  $this->assertFalse($this->_imagefile->getData('autoSubmit'));
45  }
46 }