tests/phpunit/Composer/MULoaderPluginTest.php
/**
	 * @param array $extraConfig Config for the extra section you want returned from getExtra()
	 *
	 * @return Composer|\PHPUnit\Framework\MockObject\MockObject
	 */
@param array $extraConfig Config for the extra section you want returned from getExtra()
@return Composer|\PHPUnit\Framework\MockObject\MockObject
@param array $extraConfig Config for the extra section you want returned from getExtra () @return Composer| \ PHPUnit \ Framework \ MockObject \ MockObject
private function mock_composer( array $extraConfig = [] ) {
		$package = $this->getMockBuilder( PackageInterface::class )->getMock();
		$config = $this->getMockBuilder( Config::class )->getMock();
		$composer = $this->getMockBuilder( Composer::class )->getMock();
		$package->method( 'getExtra' )->willReturn( $extraConfig);
		$config->method( 'has' )->with( 'vendor-dir' )->willReturn( false );
		$config->method( 'get' )->with( 'vendor-dir' )->willReturn( self::TMP_DIR );
		$composer->method( 'getPackage' )->willReturn( $package );
		$composer->method( 'getConfig' )->willReturn( $config );
		return $composer;
	}
private function mock_composer ( array $ extraConfig = [ ] ) { $ package = $ this -> getMockBuilder ( PackageInterface :: class ) -> getMock ( ) ; $ config = $ this -> getMockBuilder ( Config :: class ) -> getMock ( ) ; $ composer = $ this -> getMockBuilder ( Composer :: class ) -> getMock ( ) ; $ package -> method ( 'getExtra' ) -> willReturn ( $ extraConfig ) ; $ config -> method ( 'has' ) -> with ( 'vendor-dir' ) -> willReturn ( false ) ; $ config -> method ( 'get' ) -> with ( 'vendor-dir' ) -> willReturn ( self :: TMP_DIR ) ; $ composer -> method ( 'getPackage' ) -> willReturn ( $ package ) ; $ composer -> method ( 'getConfig' ) -> willReturn ( $ config ) ; return $ composer ; }
@param array $extraConfig Config for the extra section you want returned from getExtra()
 @return Composer|\PHPUnit\Framework\MockObject\MockObject
@param array $extraConfig Config for the extra section you want returned from getExtra () @return Composer| \ PHPUnit \ Framework \ MockObject \ MockObject