Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DefinitionFactoryTest.php
Go to the documentation of this file.
1 <?php
7 
11 use Magento\Framework\Interception\DefinitionInterface as InterceptionDefinitionInterface;
13 
14 class DefinitionFactoryTest extends \PHPUnit\Framework\TestCase
15 {
19  private $filesystemDriverMock;
20 
24  private $definitionFactory;
25 
26  protected function setUp()
27  {
28  $this->filesystemDriverMock = $this->createMock(File::class);
29  $this->definitionFactory = new DefinitionFactory(
30  $this->filesystemDriverMock,
31  'generation dir'
32  );
33  }
34 
35  public function testCreateClassDefinition()
36  {
37  $this->assertInstanceOf(
38  DefinitionInterface::class,
39  $this->definitionFactory->createClassDefinition()
40  );
41  }
42 
43  public function testCreatePluginDefinition()
44  {
45  $this->assertInstanceOf(
46  InterceptionDefinitionInterface::class,
47  $this->definitionFactory->createPluginDefinition()
48  );
49  }
50 
51  public function testCreateRelations()
52  {
53  $this->assertInstanceOf(
54  RelationsInterface::class,
55  $this->definitionFactory->createRelations()
56  );
57  }
58 }