/** * Execute the console command. * * @return mixed */ public function fire() { // Create translator service. $this->translator = new TranslatorService($this->getLangFiles()); $this->translator->setDefaultLocale($this->config->get('app.locale')); // Check missing translation. $this->missing = $this->flatten($this->translator->getMissing()); $this->check(); // Start interactive shell. while (true) { $action = strtoupper($this->ask('What do you want to do? [T]ranslate, [C]heck, [S]ave, [E]xit.')); if ($action === 'T') { $this->translate(); } if ($action === 'C') { $this->check(); } if ($action === 'S') { $this->save(); } if ($action === 'E') { exit; } } }
public function testNoLocalesConfigException() { // Mock Config Illuminate\Support\Facades\Config::swap($config = m::mock('ConfigMock')); $config->shouldReceive('get')->with('js-localization::config.locales')->andReturn(null); $this->setExpectedException('Exception'); $this->runCommand(); }
public function setUp() { parent::setUp(); $app = m::mock('AppMock'); $app->shouldReceive('instance')->once()->andReturn($app); Illuminate\Support\Facades\Facade::setFacadeApplication($app); Illuminate\Support\Facades\Config::swap($config = m::mock('ConfigMock')); }
/** * Parses the 2 sections (gets the splitter from config) * * @param $source * @param $offset * @return string * @throws Exceptions\TooFewSectionsException */ protected function parseSection($source, $offset) { $sections = preg_split($this->config->get('laravel-markdown-plus::section_splitter'), $source, 2); if (count($sections) != 2) { throw new TooFewSectionsException(); } return trim($sections[$offset]); }
/** * Sets the markdown parser options */ protected function setParserOptions() { $options = $this->config->get('laravel-markdown-plus::markdown_parser_options'); foreach ($options as $key => $value) { if (property_exists($this->markdownParser, $key)) { $this->markdownParser->{$key} = $value; } } }
public function setUp() { parent::setUp(); $app = m::mock('AppMock'); $app->shouldReceive('instance')->once()->andReturn($app); Illuminate\Support\Facades\Facade::setFacadeApplication($app); Illuminate\Support\Facades\Config::swap($config = m::mock('ConfigMock')); $config->shouldReceive('get')->once()->with('logviewer::log_dirs')->andReturn(array('app' => 'app/storage/logs')); $this->logviewer = new Logviewer('app', 'cgi-fcgi', '2013-06-01'); }
public function setUp() { $tmpConfig = (include 'config.php'); $app = m::mock('AppMock'); $app->shouldReceive('instance')->once()->andReturn($app); Illuminate\Support\Facades\Facade::setFacadeApplication($app); Illuminate\Support\Facades\Config::swap($config = m::mock('ConfigMock')); foreach ($tmpConfig as $key => $row) { $config->shouldReceive('get')->once()->with("smarty::{$key}")->andReturn($row); } $this->manager = new SmartyManager(m::mock('Illuminate\\View\\Engines\\EngineResolver'), m::mock('Illuminate\\View\\ViewFinderInterface'), m::mock('Illuminate\\Events\\Dispatcher'), new \Smarty()); }
public function _before() { Illuminate\Support\Facades\Config::shouldReceive('get')->with('reloquent.pagination.per_page', m::any())->andReturn(15); Illuminate\Support\Facades\Config::shouldReceive('get')->with('reloquent.limit', m::any())->andReturn(20); Illuminate\Support\Facades\Config::shouldReceive('get')->with('reloquent.debug', m::any())->andReturn(false); Illuminate\Support\Facades\Lang::shouldReceive('get')->with(m::any(), m::any())->andReturn(''); $this->model = m::mock('\\TestModel'); $this->validator = m::mock('Illuminate\\Validation\\Factory'); $this->app = m::mock('Illuminate\\Container\\Container'); $this->app->shouldReceive('make')->with($this->modelCls)->andReturn($this->model); $this->app->shouldReceive('make')->with('validator')->andReturn($this->validator); $this->repository = new TestRepository($this->app); //m::mock(new TestRepository($this->app))->makePartial(); }
<?php return array_merge(Illuminate\Support\Facades\Config::get('app-base'), Illuminate\Support\Facades\Config::get('app-custom'));