Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ParserFactoryTest.php
Go to the documentation of this file.
1 <?php
7 
9 
12 class ParserFactoryTest extends \PHPUnit\Framework\TestCase
13 {
17  protected $tokens;
18 
22  public function setUp()
23  {
24  $this->tokens = $this->getMockBuilder(
25  \Magento\TestFramework\Integrity\Library\PhpParser\Tokens::class
26  )->disableOriginalConstructor()->getMock();
27  }
28 
34  public function testCreateParsers()
35  {
36  $parseFactory = new ParserFactory();
37  $parseFactory->createParsers($this->tokens);
38  $this->assertInstanceOf(
39  \Magento\TestFramework\Integrity\Library\PhpParser\Uses::class,
40  $parseFactory->getUses()
41  );
42  $this->assertInstanceOf(
43  \Magento\TestFramework\Integrity\Library\PhpParser\StaticCalls::class,
44  $parseFactory->getStaticCalls()
45  );
46  $this->assertInstanceOf(
47  \Magento\TestFramework\Integrity\Library\PhpParser\Throws::class,
48  $parseFactory->getThrows()
49  );
50  }
51 }