Skip to content
Permalink
Browse files

Wrappers for quiet() and verbose()

  • Loading branch information...
dereuromark committed Aug 25, 2015
1 parent 683e3ad commit 072c0ce4cbb1a382e00173e54e20655eb6cbf12e
Showing with 52 additions and 0 deletions.
  1. +24 −0 src/Console/Shell.php
  2. +28 −0 tests/TestCase/Console/ShellTest.php
@@ -502,6 +502,30 @@ public function wrapText($text, $options = [])
return Text::wrap($text, $options);
}
/**
* Output at the verbose level.
*
* @param string|array $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @return int|bool Returns the number of bytes returned from writing to stdout.
*/
public function verbose($message, $newlines = 1)
{
return $this->io->verbose($message, $newlines);
}
/**
* Output at all levels.
*
* @param string|array $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @return int|bool Returns the number of bytes returned from writing to stdout.
*/
public function quiet($message, $newlines = 1)
{
return $this->io->quiet($message, $newlines);
}
/**
* Outputs a single or multiple messages to stdout. If no parameters
* are passed outputs just a newline.
@@ -263,6 +263,34 @@ public function testInNonInteractive()
$this->assertEquals('n', $result);
}
/**
* testVerbose method
*
* @return void
*/
public function testVerbose()
{
$this->io->expects($this->once())
->method('verbose')
->with('Just a test', 1);
$this->Shell->verbose('Just a test');
}
/**
* testQuiet method
*
* @return void
*/
public function testQuiet()
{
$this->io->expects($this->once())
->method('quiet')
->with('Just a test', 1);
$this->Shell->quiet('Just a test');
}
/**
* testOut method
*

0 comments on commit 072c0ce

Please sign in to comment.
You can’t perform that action at this time.