Pantheon\Terminus\Commands\Self\InfoCommand::info PHP Метод

info() публичный Метод

Print various data about the CLI environment
public info ( ) : Consolidation\OutputFormatters\StructuredData\PropertyList
Результат Consolidation\OutputFormatters\StructuredData\PropertyList
    public function info()
    {
        $config = $this->getConfig();
        $info = ['php_binary_path' => $config->get('php'), 'php_version' => $config->get('php_version'), 'php_ini' => $config->get('php_ini'), 'project_config_path' => $config->get('config_dir'), 'terminus_path' => $config->get('root'), 'terminus_version' => $config->get('version'), 'os_version' => $config->get('os_version')];
        return new PropertyList($info);
    }

Usage Example

Пример #1
0
 /**
  * Tests the self:info command
  */
 public function testInfo()
 {
     $command = new InfoCommand();
     $this->config = $this->getMockBuilder(Config::class)->disableOriginalConstructor()->getMock();
     $config_data = ['php' => '*PHPBINARY*', 'php_version' => '*PHPVERSION*', 'php_ini' => '*PHPINI*', 'config_dir' => '*CONFIGDIR*', 'root' => '*TERMINUSROOT*', 'version' => '*TERMINUSVERSION*', 'os_version' => '*OSVERSION*'];
     $output_data = ['php_binary_path' => '*PHPBINARY*', 'php_version' => '*PHPVERSION*', 'php_ini' => '*PHPINI*', 'project_config_path' => '*CONFIGDIR*', 'terminus_path' => '*TERMINUSROOT*', 'terminus_version' => '*TERMINUSVERSION*', 'os_version' => '*OSVERSION*'];
     $i = 0;
     foreach ($config_data as $key => $val) {
         $this->config->expects($this->at($i++))->method('get')->with($key)->willReturn($val);
     }
     $command->setConfig($this->config);
     $info = $command->info();
     $this->assertInstanceOf(PropertyList::class, $info);
     $this->assertEquals($output_data, $info->getArrayCopy());
 }
InfoCommand