Наследование: extends Robo\Config
Пример #1
0
 public function testGetPhpAndOSInfo()
 {
     $this->assertEquals(PHP_VERSION, $this->config->get('php_version'));
     $this->assertEquals(get_cfg_var('cfg_file_path'), $this->config->get('php_ini'));
     $this->assertEquals(PHP_BINARY, $this->config->get('php'));
     $this->assertEquals(php_uname('v'), $this->config->get('os_version'));
 }
Пример #2
0
 /**
  * Set a mocked config param
  *
  * @param array $values An array of key/values
  */
 protected function configSet($values)
 {
     $this->config->method('get')->will($this->returnCallback(function ($arg) use($values) {
         return $values[$arg];
     }));
 }
Пример #3
0
 /**
  * Register the necessary classes for Terminus
  *
  * @param \League\Container\ContainerInterface $container
  */
 private function configureContainer(ContainerInterface $container)
 {
     // Add the services.
     $container->share('request', Request::class);
     $container->inflector(RequestAwareInterface::class)->invokeMethod('setRequest', ['request']);
     $session_store = new FileStore($this->config->get('cache_dir'));
     $session = new Session($session_store);
     $container->share('session', $session);
     $container->inflector(SessionAwareInterface::class)->invokeMethod('setSession', ['session']);
     $token_store = new FileStore($this->config->get('tokens_dir'));
     $container->inflector(SavedTokens::class)->invokeMethod('setDataStore', [$token_store]);
     // Add the models and collections
     $container->add(User::class);
     $container->add(SavedTokens::class);
     $container->add(SavedToken::class);
     $container->add(PaymentMethods::class);
     $container->add(PaymentMethod::class);
     $container->add(SSHKeys::class);
     $container->add(SSHKey::class);
     $container->add(Workflows::class);
     $container->add(Workflow::class);
     $container->add(WorkflowOperation::class);
     $container->add(MachineTokens::class);
     $container->add(MachineToken::class);
     $container->add(Upstream::class);
     $container->add(Upstreams::class);
     $container->add(UserSiteMemberships::class);
     $container->add(UserSiteMembership::class);
     $container->add(UserOrganizationMemberships::class);
     $container->add(UserOrganizationMembership::class);
     $container->add(OrganizationSiteMemberships::class);
     $container->add(OrganizationSiteMembership::class);
     $container->add(OrganizationUserMemberships::class);
     $container->add(OrganizationUserMembership::class);
     $container->add(Organization::class);
     $container->add(Branches::class);
     $container->add(Branch::class);
     $container->add(SiteUserMemberships::class);
     $container->add(SiteUserMembership::class);
     $container->add(SiteOrganizationMemberships::class);
     $container->add(SiteOrganizationMembership::class);
     $container->add(Site::class);
     $container->add(Redis::class);
     $container->add(Solr::class);
     $container->add(Environments::class);
     $container->add(Environment::class);
     $container->add(Backups::class);
     $container->add(Backup::class);
     $container->add(Lock::class);
     $container->add(Bindings::class);
     $container->add(Binding::class);
     $container->add(Domains::class);
     $container->add(Domain::class);
     $container->add(Commits::class);
     $container->add(Commit::class);
     $container->add(NewRelic::class);
     $container->add(Tags::class);
     $container->add(Tag::class);
     $container->share('sites', Sites::class);
     $container->inflector(SiteAwareInterface::class)->invokeMethod('setSites', ['sites']);
     // Add the commands.
     $factory = $container->get('commandFactory');
     $factory->setIncludeAllPublicMethods(false);
     $commands_directory = __DIR__ . '/Commands';
     $top_namespace = 'Pantheon\\Terminus\\Commands';
     $this->commands = $this->getCommands(['path' => $commands_directory, 'namespace' => $top_namespace]);
     $this->commands[] = 'Pantheon\\Terminus\\Authorizer';
 }