Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DummyTest.php
Go to the documentation of this file.
1 <?php
8 
9 use \Magento\Framework\App\Cache\Tag\Strategy\Dummy;
10 
11 class DummyTest extends \PHPUnit\Framework\TestCase
12 {
13 
14  private $model;
15 
16  protected function setUp()
17  {
18  $this->model = new Dummy();
19  }
20 
21  public function testGetTagsWithScalar()
22  {
23  $this->expectException(\InvalidArgumentException::class);
24  $this->expectExceptionMessage('Provided argument is not an object');
25  $this->model->getTags('scalar');
26  }
27 
28  public function testGetTagsWithObject()
29  {
30  $emptyArray = [];
31 
32  $this->assertEquals($emptyArray, $this->model->getTags(new \stdClass));
33 
34  $identityInterface = $this->getMockForAbstractClass(\Magento\Framework\DataObject\IdentityInterface::class);
35  $this->assertEquals($emptyArray, $this->model->getTags($identityInterface));
36  }
37 }