public function testGetInstaller() { $package = $this->getMock('\\Composer\\Package\\RootPackageInterface'); $config = $this->getMock('\\Composer\\Config'); $download = $this->getMockBuilder('\\Composer\\Downloader\\DownloadManager')->disableOriginalConstructor()->getMock(); $repository = $this->getMockBuilder('\\Composer\\Repository\\RepositoryManager')->disableOriginalConstructor()->getMock(); $locker = $this->getMockBuilder('\\Composer\\Package\\Locker')->disableOriginalConstructor()->getMock(); $installation = $this->getMock('\\Composer\\Installer\\InstallationManager'); $event = $this->getMockBuilder('\\Composer\\EventDispatcher\\EventDispatcher')->disableOriginalConstructor()->getMock(); $autoload = $this->getMockBuilder('\\Composer\\Autoload\\AutoloadGenerator')->disableOriginalConstructor()->getMock(); if (defined('PHP_WINDOWS_VERSION_BUILD')) { $download->expects($this->once())->method('setOutputProgress')->will($this->returnSelf())->with(false); } $composer = $this->getComposer(); $composer->expects($this->once())->method('getConfig')->will($this->returnValue($config)); $composer->expects($this->once())->method('getPackage')->will($this->returnValue($package)); $composer->expects($this->atLeastOnce())->method('getDownloadManager')->will($this->returnValue($download)); $composer->expects($this->once())->method('getRepositoryManager')->will($this->returnValue($repository)); $composer->expects($this->once())->method('getLocker')->will($this->returnValue($locker)); $composer->expects($this->once())->method('getInstallationManager')->will($this->returnValue($installation)); $composer->expects($this->once())->method('getEventDispatcher')->will($this->returnValue($event)); $composer->expects($this->once())->method('getAutoloadGenerator')->will($this->returnValue($autoload)); $installer = $this->composer->getInstaller(); // test $this->assertInstanceOf('\\Composer\\Installer', $installer); }