/** * 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()); }