/** * Create a new art loader * * @param \holyshared\fixture\Loader */ public function __construct(Loader $loader) { $this->output = new Output(); $this->output->sameLine(); $this->output->defaultTo('buffer'); $this->cli = new CLImate(); $this->cli->setOutput($this->output); $this->loader = $loader; }
public function setUp() { $this->app = $this->getMockBuilder(CliApp::class)->setMethods(['getCli'])->getMock(); $output = new Output(); $output->defaultTo('buffer'); $this->buffer = $output->get('buffer'); $cli = new CLImate(); $cli->setOutput($output); $this->app->method('getCli')->will($this->returnValue($cli)); }
public function registerClimate(Container $container) { $container['climate/system'] = function (Container $container) { $system = Mockery::mock(Linux::class); $system->shouldReceive('hasAnsiSupport')->andReturn(true); $system->shouldReceive('width')->andReturn(80); return $system; }; $container['climate/output'] = function (Container $container) { $output = Mockery::mock(Output::class); $output->shouldReceive('persist')->andReturn($output); $output->shouldReceive('sameLine')->andReturn($output); $output->shouldReceive('write'); return $output; }; $container['climate/reader'] = function (Container $container) { $reader = Mockery::mock(Stdin::class); $reader->shouldReceive('line')->andReturn('line'); $reader->shouldReceive('char')->andReturn('char'); $reader->shouldReceive('multiLine')->andReturn('multiLine'); return $reader; }; $container['climate/util'] = function (Container $container) { return new UtilFactory($container['climate/system']); }; $container['climate'] = function (Container $container) { $climate = new CLImate(); $climate->setOutput($container['climate/output']); $climate->setUtil($container['climate/util']); $climate->setReader($container['climate/reader']); return $climate; }; }