Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
BlockTest.php
Go to the documentation of this file.
1 <?php
7 
8 class BlockTest extends \PHPUnit\Framework\TestCase
9 {
13  protected $block;
14 
15  protected function setUp()
16  {
17  $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
18  $this->block = $objectManager->getObject(\Magento\Cms\Block\Block::class);
19  }
20 
21  protected function tearDown()
22  {
23  $this->block = null;
24  }
25 
26  public function testGetIdentities()
27  {
28  $id = 1;
29  $this->block->setBlockId($id);
30  $this->assertEquals([\Magento\Cms\Model\Block::CACHE_TAG . '_' . $id], $this->block->getIdentities());
31  }
32 }
$objectManager
Definition: bootstrap.php:17
$id
Definition: fieldset.phtml:14