/** * @param array $elements * @return void * @dataProvider importExportElementsDataProvider */ public function testConstructImportExportElements($elements) { $this->assertSame([], $this->_structure->exportElements()); $this->_structure->importElements($elements); $this->assertSame($elements, $this->_structure->exportElements()); $structure = new \Magento\Framework\Data\Structure($elements); $this->assertSame($elements, $structure->exportElements()); }
public function testConstructorStructure() { $structure = new \Magento\Framework\Data\Structure(); $structure->createElement('test.container', array()); /** @var $layout \Magento\Framework\View\LayoutInterface */ $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Framework\\View\\Layout', array('structure' => $structure)); $this->assertTrue($layout->hasElement('test.container')); }