/** * @return Application */ public static function createApplication() { $package = \Mockery::mock('Composer\\Package\\PackageInterface'); $package->shouldReceive('getPrettyVersion')->andReturn('test'); $embeddedComposer = \Mockery::mock('Dflydev\\EmbeddedComposer\\Core\\EmbeddedComposerInterface'); $embeddedComposer->shouldReceive('findPackage')->once()->andReturn($package); $config = \Mockery::mock('Composer\\Config'); $config->shouldReceive('has')->andReturn(false); $embeddedComposer->shouldReceive('getExternalComposerConfig')->andReturn($config); $embeddedComposer->shouldReceive('getExternalRootDirectory')->andReturn(__DIR__); // doesn't matter. return Application::create($embeddedComposer); }