+ public static function provideStripOuterParagraph() {
+ // This mimics the most common use case (stripping paragraphs generated by the parser).
+ $message = new RawMessage( "Message text." );
+
+ return array(
+ array(
+ "<p>Text.</p>",
+ "Text.",
+ ),
+ array(
+ "<p class='foo'>Text.</p>",
+ "<p class='foo'>Text.</p>",
+ ),
+ array(
+ "<p>Text.\n</p>\n",
+ "Text.",
+ ),
+ array(
+ "<p>Text.</p><p>More text.</p>",
+ "<p>Text.</p><p>More text.</p>",
+ ),
+ array(
+ $message->parse(),
+ "Message text.",
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider provideStripOuterParagraph
+ * @covers Parser::stripOuterParagraph
+ */
+ public function testStripOuterParagraph( $text, $expected ) {
+ $this->assertEquals( $expected, Parser::stripOuterParagraph( $text ) );
+ }
+