From 9441dde8bfb95277df073717ed7817dced40f948 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 28 Mar 2014 05:41:12 +0100 Subject: Update to MediaWiki 1.22.5 --- tests/phpunit/includes/parser/TidyTest.php | 44 ++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/phpunit/includes/parser/TidyTest.php (limited to 'tests/phpunit/includes/parser/TidyTest.php') diff --git a/tests/phpunit/includes/parser/TidyTest.php b/tests/phpunit/includes/parser/TidyTest.php new file mode 100644 index 00000000..57a88b9d --- /dev/null +++ b/tests/phpunit/includes/parser/TidyTest.php @@ -0,0 +1,44 @@ +markTestSkipped( 'Tidy not found' ); + } + } + + /** + * @dataProvider provideTestWrapping + */ + public function testTidyWrapping( $expected, $text, $msg = '' ) { + $text = MWTidy::tidy( $text ); + // We don't care about where Tidy wants to stick is

s + $text = trim( preg_replace( '##', '', $text ) ); + // Windows, we love you! + $text = str_replace( "\r", '', $text ); + $this->assertEquals( $expected, $text, $msg ); + } + + public function provideTestWrapping() { + return array( + array( + 'foo', + 'foo', + ' should survive tidy' + ), + array( + 'foo', + 'foo', + ' should survive tidy' + ), + array( 'foo', 'foo', ' should survive tidy' ), + array( "\nfoo", 'foo', ' should survive tidy' ), + array( "\nfoo", 'foo', ' should survive tidy' ), + ); + } +} \ No newline at end of file -- cgit v1.2.2