/** * {@inheritdoc} */ public function asString() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'asString'); if (!$pluginInfo) { return parent::asString(); } else { return $this->___callPlugins('asString', func_get_args(), $pluginInfo); } }
public function testLoadDbApp() { $this->_resource->expects($this->any())->method('fetchUpdatesByHandle')->with('fixture_handle', $this->_theme, $this->scope)->will($this->returnValue(self::FIXTURE_LAYOUT_XML)); $this->assertEmpty($this->_model->getHandles()); $this->assertEmpty($this->_model->asString()); $handles = ['fixture_handle_one']; $this->_model->load($handles); $this->assertEquals($handles, $this->_model->getHandles()); $this->assertXmlStringEqualsXmlString('<body>' . self::FIXTURE_LAYOUT_XML . '</body>', $this->_model->asString()); }
public function testLoadDbApp() { $this->assertEmpty($this->model->getHandles()); $this->assertEmpty($this->model->asString()); $handles = ['fixture_handle_one', 'fixture_handle_two']; $this->model->load($handles); $expectedResult = ' <root> <body> <block class="Magento\\Framework\\View\\Element\\Template" template="fixture_template_one.phtml"/> </body> <body> <block class="Magento\\Framework\\View\\Element\\Template" template="fixture_template_two.phtml"/> </body> </root> '; $actualResult = '<root>' . $this->model->asString() . '</root>'; $this->assertXmlStringEqualsXmlString($expectedResult, $actualResult); }