/** * Adds a labeled paragraph to the alignment. * * @param LabeledParagraph $paragraph The labeled paragraph. * @param int $indentation The indentation of the paragraph. */ public function add(LabeledParagraph $paragraph, $indentation = 0) { if ($paragraph->isAligned()) { $this->paragraphs[] = $paragraph; $this->indentations[] = $indentation; } }
public function testRenderWithLabelDistanceWrapsText() { $para = new LabeledParagraph('Label', self::LOREM_IPSUM, 6); $para->render($this->io); $expected = <<<'EOF' Label Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt EOF; $this->assertSame($expected, $this->io->fetchOutput()); }