/** * Covered createParsers method * * @test */ public function testCreateParsers() { $parseFactory = new ParserFactory(); $parseFactory->createParsers($this->tokens); $this->assertInstanceOf('Magento\\TestFramework\\Integrity\\Library\\PhpParser\\Uses', $parseFactory->getUses()); $this->assertInstanceOf('Magento\\TestFramework\\Integrity\\Library\\PhpParser\\StaticCalls', $parseFactory->getStaticCalls()); $this->assertInstanceOf('Magento\\TestFramework\\Integrity\\Library\\PhpParser\\Throws', $parseFactory->getThrows()); }
/** * Covered getDependencies method * * @test */ public function testGetDependencies() { $uses = $this->getMockBuilder('Magento\\TestFramework\\Integrity\\Library\\PhpParser\\Uses')->disableOriginalConstructor()->getMock(); $this->parseFactory->expects($this->exactly(2))->method('getUses')->will($this->returnValue($uses)); $staticCalls = $this->getMockBuilder('Magento\\TestFramework\\Integrity\\Library\\PhpParser\\StaticCalls')->disableOriginalConstructor()->getMock(); $staticCalls->expects($this->once())->method('getDependencies')->will($this->returnValue(array('StaticDependency'))); $this->parseFactory->expects($this->once())->method('getStaticCalls')->will($this->returnValue($staticCalls)); $throws = $this->getMockBuilder('Magento\\TestFramework\\Integrity\\Library\\PhpParser\\Throws')->disableOriginalConstructor()->getMock(); $throws->expects($this->once())->method('getDependencies')->will($this->returnValue(array('ThrowDependency'))); $this->parseFactory->expects($this->once())->method('getThrows')->will($this->returnValue($throws)); $this->tokens = new Tokens($this->content, $this->parseFactory); $this->assertEquals(array('StaticDependency', 'ThrowDependency'), $this->tokens->getDependencies()); }