Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

… being printed properly.
  • Loading branch information...
commit 57a549e79baa16917b2840443b8972274493f21d 1 parent d88b211
Nate Abele nateabele authored
2  console/command/Help.php
@@ -305,7 +305,7 @@ protected function _renderUsage($command, $method, $properties = array()) {
305 305 */
306 306 protected function _renderDescription($info) {
307 307 $this->out('DESCRIPTION', 'heading');
308   - $this->out($this->_pad(strtok($info['description'], "\n"), 1));
  308 + $this->out($this->_pad($info['description']), 1);
309 309 }
310 310
311 311 /**
16 tests/cases/console/command/HelpTest.php
@@ -161,6 +161,22 @@ public function testApiProperties() {
161 161 $result = $help->response->output;
162 162 $this->assertPattern("/{$expected}/s", $result);
163 163 }
  164 +
  165 + /**
  166 + * Tests that the `Help` command prints a class' full description with all lines, not just the
  167 + * first.
  168 + */
  169 + public function testPrintFullClassDoc() {
  170 + $command = new Help(array(
  171 + 'request' => $this->request, 'classes' => $this->classes
  172 + ));
  173 +
  174 + $this->assertTrue($command->run('Create'));
  175 + $lines = explode(PHP_EOL, $command->response->output);
  176 +
  177 + $offset = array_search('DESCRIPTION', $lines);
  178 + $this->assertEqual('OPTIONS', $lines[$offset + 3]);
  179 + }
164 180 }
165 181
166 182 ?>

0 comments on commit 57a549e

Please sign in to comment.
Something went wrong with that request. Please try again.