示例#1
0
 public function table()
 {
     $data = array();
     foreach ($this->required_keys as $key) {
         $value = $this[$key];
         if (empty($value) || $value === '@required' || is_array($value) && $value[0] === '@required') {
             $value = $this->command->ascii(' - MISSING - ', NULL, 'bold', 'red');
             if (is_array($this[$key])) {
                 $value = array($value);
             }
         }
         $data[$key] = $value;
     }
     return drush_format_table(drush_key_value_to_array_table($data));
 }
示例#2
0
 /**
  * Tests drush_format_table() with word wrapping.
  *
  * @see drush_format_table().
  */
 public function testFormatTableWordWrap()
 {
     drush_set_context('DRUSH_COLUMNS', 60);
     $output = drush_format_table($this->words);
     $expected = ' Drush is a command  scripting         for Drupal         ' . PHP_EOL . ' line shell          interface                            ' . PHP_EOL . ' A veritable         Swiss Army knife  designed to make   ' . PHP_EOL . '                                       life easier for us ' . PHP_EOL;
     $this->assertEquals($expected, $output);
 }