Пример #1
0
 /**
  * Configures console application
  */
 public function bootstrap()
 {
     $coreBuilder = new CoreBuilder();
     $this->container = $coreBuilder->buildContainer($this->argParser, $this->config);
     $coreBuilder->buildLogger($this->container);
     Registry::set('container', $this->container);
     $this->app = new ConsoleApp('CMS Slack Bot', '@package_version@');
     $this->app->add(new commands\ServerStartCommand($this->container['config'], $this->container['argv_parser']));
     $this->app->add(new commands\ServerStopCommand($this->container['config']));
     $this->app->add(new commands\ServerStatusCommand($this->container['config']));
     $this->app->add(new commands\PlaybookRunCommand($this->container['curl_request'], $this->container['variables_placer'], $this->container['file_loader']));
     $this->app->add(new commands\RtmStartCommand($this->config, $this->container['curl_request']));
     $this->app->add(new commands\RtmStopCommand($this->container['config']));
     $this->app->add(new commands\CronWorkerCommand($this->container['curl_request'], $this->container['cron_expression'], $this->container['file_loader']));
     $this->app->add(new commands\ApiStubStartCommand());
     $this->app->add(new commands\RtmStubStartCommand());
 }
Пример #2
0
 /** @test */
 public function shouldStoreDataInRegistry()
 {
     Registry::set('test', '123');
     $this->assertEquals('123', Registry::get('test'));
 }
Пример #3
0
 /**
  * Unset all variables
  */
 public static function clear()
 {
     Registry::set('variables', []);
 }