Skip to content

Commit

Permalink
New live template 2magento test layout frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
jalogut committed May 7, 2018
1 parent d4bad9d commit 70ec196
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Preferences/templates/StmpflMagento2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -770,4 +770,11 @@
<option name="PHP" value="true" />
</context>
</template>
<template name="2magento test layout frontend" value="/**&#10; * @magentoAppArea frontend&#10; */&#10;public function test$testName$()&#10;{&#10; $layout = $this-&gt;getLayout('$handle$');&#10; // Your test here...&#10;}&#10;&#10;/**&#10; * @param string|string[] $handles&#10; * @return \Magento\Framework\View\LayoutInterface&#10; */&#10;protected function getLayout($handles)&#10;{&#10; /** @var \Magento\Framework\View\Result\Page $resultPage */&#10; $resultPage = $this-&gt;_objectManager-&gt;get(\Magento\Framework\View\Result\Page::class);&#10; $resultPage-&gt;addHandle('default');&#10; $resultPage-&gt;addHandle($handles);&#10; return $resultPage-&gt;getLayout();&#10;}" description="" toReformat="false" toShortenFQNames="true">
<variable name="testName" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="handle" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
</templateSet>
1 change: 1 addition & 0 deletions docs/liveTemplates.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,4 @@
* 2magento test command execute method
* 2magento test email
* 2magento test loadFixture methods
* 2magento test layout frontend

0 comments on commit 70ec196

Please sign in to comment.