Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions | Protected Attributes
TemplateTest Class Reference
Inheritance diagram for TemplateTest:

Public Member Functions

 testGetFormKey ()
 
 testIsOutputEnabledTrue ()
 
 testIsOutputEnabledFalse ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

 $_block
 

Detailed Description

Test class for \Magento\Backend\Block\Template.

@magentoAppArea adminhtml

Definition at line 13 of file TemplateTest.php.

Member Function Documentation

◆ setUp()

setUp ( )
protected

Definition at line 20 of file TemplateTest.php.

21  {
22  parent::setUp();
24  \Magento\Framework\View\LayoutInterface::class
25  )->createBlock(
26  \Magento\Backend\Block\Template::class
27  );
28  }

◆ testGetFormKey()

testGetFormKey ( )

@covers \Magento\Backend\Block\Template::getFormKey

Definition at line 33 of file TemplateTest.php.

34  {
35  $this->assertGreaterThan(15, strlen($this->_block->getFormKey()));
36  }

◆ testIsOutputEnabledFalse()

testIsOutputEnabledFalse ( )

@magentoAppArea adminhtml @covers \Magento\Backend\Block\Template::isOutputEnabled @magentoConfigFixture current_store advanced/modules_disable_output/dummy 0

Definition at line 54 of file TemplateTest.php.

55  {
56  $this->_block->setData('module_name', 'dummy');
57  $this->assertTrue($this->_block->isOutputEnabled('dummy'));
58  }

◆ testIsOutputEnabledTrue()

testIsOutputEnabledTrue ( )

@magentoAppArea adminhtml @covers \Magento\Backend\Block\Template::isOutputEnabled @magentoConfigFixture current_store advanced/modules_disable_output/dummy 1

Definition at line 43 of file TemplateTest.php.

44  {
45  $this->_block->setData('module_name', 'dummy');
46  $this->assertFalse($this->_block->isOutputEnabled('dummy'));
47  }

Field Documentation

◆ $_block

$_block
protected

Definition at line 18 of file TemplateTest.php.


The documentation for this class was generated from the following file: