'text', 'text' => 'Text', ]; /** @var pQuery */ private $parser; public function _before() { parent::_before(); $this->parser = new pQuery; } public function testItRendersPlainText() { $output = (new Text)->render($this->block); $expectedResult = ' Text '; expect($output)->equals($expectedResult); } public function testItRendersParagraph() { $this->block['text'] = '

Text

'; $output = (new Text)->render($this->block); $table = $this->parser->parseStr($output)->query('table'); assert($table instanceof \pQuery); $paragraphTable = $table[0]->toString(); $expectedResult = '
Text
'; expect($paragraphTable)->equals($expectedResult); } public function testItRendersList() { $this->block['text'] = ''; $output = (new Text)->render($this->block); $ul = $this->parser->parseStr($output)->query('ul'); assert($ul instanceof \pQuery); $list = $ul[0]->toString(); $expectedResult = ''; expect($list)->equals($expectedResult); } public function testItRendersBlockquotes() { $this->block['text'] = '

Quote

'; $output = (new Text)->render($this->block); $table = $this->parser->parseStr($output)->query('table'); assert($table instanceof \pQuery); $blockquoteTable = $table[0]->toString(); $expectedResult = '
Quote
'; expect($blockquoteTable)->equals($expectedResult); } public function testItShouldRemoveEmptyParagraphs() { $this->block['text'] = '

Text

Text2

'; $output = (new Text)->render($this->block); $expectedResult = '
Text

Text2

'; expect($output)->equals($expectedResult); } public function testItStylesHeadings() { $this->block['text'] = '

Heading

Heading 2

'; $output = (new Text)->render($this->block); expect($output)->stringContainsString('

Heading

'); expect($output)->stringContainsString('

Heading 2

'); } public function testItStylesHeadingsCenter() { $this->block['text'] = '

Let\'s Get Started!

'; $output = (new Text)->render($this->block); expect($output)->stringContainsString('