warning() public method

Formats an warning result bar.
public warning ( string | array $message )
$message string | array
示例#1
0
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $io = new ConsoleIO($input, $output);
     $io->write(['', $this->getSpressAsciiArt(), '', 'Hola user and welcome!', '', 'More information at <comment>http://spress.yosymfony.com</comment> or <comment>@spress_cms</comment> on Twitter', '']);
     if ($this->isUnstableVersion()) {
         $io->warning('This is a unstable version');
     }
     $command = $this->getApplication()->find('list');
     $arguments = new ArrayInput(['command' => 'list']);
     $command->run($arguments, $output);
 }
示例#2
0
 public function testWarning()
 {
     $this->command->setCode(function (InputInterface $input, OutputInterface $output) use(&$isDecorated) {
         $io = new ConsoleIO($input, $output);
         $io->warning('warning!');
     });
     $this->tester->execute([], ['interactive' => false, 'decorated' => false]);
     $this->assertRegExp("/\\[WARNING\\] warning!/", $this->tester->getDisplay(true));
 }