config->set('AutoFormat.AutoParagraph', true);
    }
    public function testSingleParagraph()
    {
        $this->assertResult(
            'Foobar',
            '
Foobar
'
        );
    }
    public function testSingleMultiLineParagraph()
    {
        $this->assertResult(
'Par 1
Par 1 still',
'Par 1
Par 1 still
'
        );
    }
    public function testTwoParagraphs()
    {
        $this->assertResult(
'Par1
Par2',
"Par1
Par2
"
        );
    }
    public function testTwoParagraphsWithLotsOfSpace()
    {
        $this->assertResult(
'Par1
Par2',
'Par1
Par2
'
        );
    }
    public function testTwoParagraphsWithInlineElements()
    {
        $this->assertResult(
'Par1
Par2',
'Par1
Par2
'
        );
    }
    public function testSingleParagraphThatLooksLikeTwo()
    {
        $this->assertResult(
'Par1
Par2',
'Par1
Par2
'
        );
    }
    public function testAddParagraphAdjacentToParagraph()
    {
        $this->assertResult(
            'Par1Par2
',
'Par1
Par2
'
        );
    }
    public function testParagraphUnclosedInlineElement()
    {
        $this->assertResult(
            'Par1',
            'Par1
'
        );
    }
    public function testPreservePreTags()
    {
        $this->assertResult(
'Par1
Par1
'
        );
    }
    public function testIgnoreTrailingWhitespace()
    {
        $this->assertResult(
'Par1
  ',
'Par1
'
        );
    }
    public function testDoNotParagraphBlockElements()
    {
        $this->assertResult(
'Par1
Par2
Par3',
'Par1
Par2
Par3
'
        );
    }
    public function testParagraphTextAndInlineNodes()
    {
        $this->assertResult(
'Par1',
            'Par1
'
        );
    }
    public function testPreserveLeadingWhitespace()
    {
        $this->assertResult(
'
Par',
'
Par
'
        );
    }
    public function testPreserveSurroundingWhitespace()
    {
        $this->assertResult(
'
Par
',
'
Par
'
        );
    }
    public function testParagraphInsideBlockNode()
    {
        $this->assertResult(
'Par1
Par2
',
''
        );
    }
    public function testParagraphInlineNodeInsideBlockNode()
    {
        $this->assertResult(
'Par1
Par2
',
''
        );
    }
    public function testNoParagraphWhenOnlyOneInsideBlockNode()
    {
        $this->assertResult('Par1
');
    }
    public function testParagraphTwoInlineNodesInsideBlockNode()
    {
        $this->assertResult(
'Par1
Par2
',
''
        );
    }
    public function testPreserveInlineNodesInPreTag()
    {
        $this->assertResult(
'Par1
Par2
'
        );
    }
    public function testSplitUpInternalsOfPTagInBlockNode()
    {
        $this->assertResult(
'',
''
        );
    }
    public function testSplitUpInlineNodesInPTagInBlockNode()
    {
        $this->assertResult(
'',
''
        );
    }
    public function testNoParagraphSingleInlineNodeInBlockNode()
    {
        $this->assertResult( 'Foo
' );
    }
    public function testParagraphInBlockquote()
    {
        $this->assertResult(
'Par1
Par2
',
'Par1
Par2
'
        );
    }
    public function testNoParagraphBetweenListItem()
    {
        $this->assertResult(
''
        );
    }
    public function testParagraphSingleElementWithSurroundingSpace()
    {
        $this->assertResult(
'
Bar
',
        ''
        );
    }
    public function testIgnoreExtraSpaceWithLeadingInlineNode()
    {
        $this->assertResult(
'Par1a
Par2',
'Par1a
Par2
'
        );
    }
    public function testAbsorbExtraEndingPTag()
    {
        $this->assertResult(
'Par1
Par2',
'Par1
Par2
'
        );
    }
    public function testAbsorbExtraEndingDivTag()
    {
        $this->assertResult(
'Par1
Par2',
'Par1
Par2
'
        );
    }
    public function testDoNotParagraphSingleSurroundingSpaceInBlockNode()
    {
        $this->assertResult(
'
Par1
'
        );
    }
    public function testBlockNodeTextDelimeterInBlockNode()
    {
        $this->assertResult(
'',
''
        );
    }
    public function testBlockNodeTextDelimeterWithoutDoublespaceInBlockNode()
    {
        $this->assertResult(
''
        );
    }
    public function testBlockNodeTextDelimeterWithoutDoublespace()
    {
        $this->assertResult(
'Par1
Par2
',
'Par1
Par2
'
        );
    }
    public function testTwoParagraphsOfTextAndInlineNode()
    {
        $this->assertResult(
'Par1
Par2',
'Par1
Par2
'
        );
    }
    public function testLeadingInlineNodeParagraph()
    {
        $this->assertResult(
'![]() Foo',
'
 Foo',
'![]() Foo
 Foo
'
        );
    }
    public function testTrailingInlineNodeParagraph()
    {
        $this->assertResult(
'Foo bar'
        );
    }
    public function testTwoInlineNodeParagraph()
    {
        $this->assertResult(
'bazbar'
        );
    }
    public function testNoParagraphTrailingBlockNodeInBlockNode()
    {
        $this->assertResult(
''
        );
    }
    public function testParagraphTrailingBlockNodeWithDoublespaceInBlockNode()
    {
        $this->assertResult(
'',
''
        );
    }
    public function testParagraphTwoInlineNodesAndWhitespaceNode()
    {
        $this->assertResult(
'One Two',
'One Two
'
        );
    }
    public function testNoParagraphWithInlineRootNode()
    {
        $this->config->set('HTML.Parent', 'span');
        $this->assertResult(
'Par
Par2'
        );
    }
    public function testInlineAndBlockTagInDivNoParagraph()
    {
        $this->assertResult(
            ''
        );
    }
    public function testInlineAndBlockTagInDivNeedingParagraph()
    {
        $this->assertResult(
'',
''
        );
    }
    public function testTextInlineNodeTextThenDoubleNewlineNeedsParagraph()
    {
        $this->assertResult(
'',
''
        );
    }
    public function testUpcomingTokenHasNewline()
    {
        $this->assertResult(
'Testfoobarbingbang
boo
',
''
);
    }
    public function testEmptyTokenAtEndOfDiv()
    {
        $this->assertResult(
'',
''
);
    }
    public function testEmptyDoubleLineTokenAtEndOfDiv()
    {
        $this->assertResult(
'',
''
);
    }
    public function testTextState11Root()
    {
        $this->assertResult('   ');
    }
    public function testTextState11Element()
    {
        $this->assertResult(
"");
    }
    public function testTextStateLikeElementState111NoWhitespace()
    {
        $this->assertResult('', '');
    }
    public function testElementState111NoWhitespace()
    {
        $this->assertResult('', '');
    }
    public function testElementState133()
    {
        $this->assertResult(
"",
""
);
    }
    public function testElementState22()
    {
        $this->assertResult(
            ''
        );
    }
    public function testElementState311()
    {
        $this->assertResult(
            'Foo
Bar',
'Foo
Bar
'
        );
    }
    public function testAutoClose()
    {
        $this->assertResult(
            '
'
        );
    }
    public function testErrorNeeded()
    {
        $this->config->set('HTML.Allowed', 'b');
        $this->expectError('Cannot enable AutoParagraph injector because p is not allowed');
        $this->assertResult('foobar');
    }
    public function testParentElement()
    {
        $this->config->set('HTML.Allowed', 'p,ul,li');
        $this->assertResult('Foo', "Foo
\n\n");
    }
}
// vim: et sw=4 sts=4