public function testPrepare() { /** * @TODO: Need to use ObjectManager instead 'new'. * On this moment we have next bug MAGETWO-4274 which blocker for this key. */ $this->_model = new \Magento\Framework\View\Layout\Element(__DIR__ . '/_files/_layout_update.xml', 0, true); list($blockNode) = $this->_model->xpath('//block[@name="head"]'); list($actionNode) = $this->_model->xpath('//action[@method="setTitle"]'); $this->assertEmpty($blockNode->attributes()->parent); $this->assertEmpty($actionNode->attributes()->block); $this->_model->prepare(); $this->assertEquals('root', (string) $blockNode->attributes()->parent); $this->assertEquals('Magento\\Backend\\Block\\Page\\Head', (string) $blockNode->attributes()->class); $this->assertEquals('head', (string) $actionNode->attributes()->block); }