Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing issue in `Help` command where full class descriptions were not…

… being printed properly.
  • Loading branch information...
commit 57a549e79baa16917b2840443b8972274493f21d 1 parent d88b211
@nateabele nateabele authored
View
2  console/command/Help.php
@@ -305,7 +305,7 @@ protected function _renderUsage($command, $method, $properties = array()) {
*/
protected function _renderDescription($info) {
$this->out('DESCRIPTION', 'heading');
- $this->out($this->_pad(strtok($info['description'], "\n"), 1));
+ $this->out($this->_pad($info['description']), 1);
}
/**
View
16 tests/cases/console/command/HelpTest.php
@@ -161,6 +161,22 @@ public function testApiProperties() {
$result = $help->response->output;
$this->assertPattern("/{$expected}/s", $result);
}
+
+ /**
+ * Tests that the `Help` command prints a class' full description with all lines, not just the
+ * first.
+ */
+ public function testPrintFullClassDoc() {
+ $command = new Help(array(
+ 'request' => $this->request, 'classes' => $this->classes
+ ));
+
+ $this->assertTrue($command->run('Create'));
+ $lines = explode(PHP_EOL, $command->response->output);
+
+ $offset = array_search('DESCRIPTION', $lines);
+ $this->assertEqual('OPTIONS', $lines[$offset + 3]);
+ }
}
?>
Please sign in to comment.
Something went wrong with that request. Please try again.