Author: Aaron Scherer (aequasi@gmail.com)
Inheritance: extends Symfony\Component\Console\Application, implements Dflydev\EmbeddedComposer\Core\EmbeddedComposerAwareInterface
Example #1
0
 /**
  * @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);
 }