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

Public Member Functions

 testGetByIdentifier (array $blockData)
 
 testGetByIdentifierDataProvider ()
 

Detailed Description

@magentoAppArea adminhtml

Definition at line 20 of file BlockTest.php.

Member Function Documentation

◆ testGetByIdentifier()

testGetByIdentifier ( array  $blockData)

Tests the get by identifier command

Parameters
array$blockData
Exceptions

Definition at line 63 of file BlockTest.php.

64  {
65  # Prepare and save the temporary block
66  $tempBlock = $this->blockFactory->create();
67  $tempBlock->setData($blockData);
68  $this->blockResource->save($tempBlock);
69 
70  # Load previously created block and compare identifiers
71  $storeId = reset($blockData['stores']);
72  $block = $this->blockIdentifier->execute($blockData['identifier'], $storeId);
73  $this->assertEquals($blockData['identifier'], $block->getIdentifier());
74  }
$block
Definition: block.php:8

◆ testGetByIdentifierDataProvider()

testGetByIdentifierDataProvider ( )

Data provider for "testGetByIdentifier" and "testUpdateTime" method

Returns
array

Definition at line 115 of file BlockTest.php.

115  : array
116  {
117  return [
118  [
119  'data' => [
120  'title' => 'Test title',
121  'stores' => [0],
122  'identifier' => 'test-identifier',
123  'content' => 'Test content',
124  'is_active' => 1
125  ]
126  ]
127  ];
128  }

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