From d365166dc05f1562503eb68900c227e6a64c964f Mon Sep 17 00:00:00 2001 From: Joel Uckelman Date: Sun, 18 Mar 2012 01:59:16 +0100 Subject: Moved list footer stripping to strip_list_footer(). --- test/build_postTest.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'test/build_postTest.php') diff --git a/test/build_postTest.php b/test/build_postTest.php index 5e8017e..3dc2cb5 100644 --- a/test/build_postTest.php +++ b/test/build_postTest.php @@ -60,6 +60,41 @@ class build_post_test extends PHPUnit_Framework_TestCase { array('[l]', '[f]', 'Edit: Re: Subject [l][f] Subject', true, 'Re: Subject Subject') ); } + + function test_strip_list_footer() { + $exp = "Thus spake uckelman: +> The changes appear to have munged SELinux permissions for the list +> bridge. Trying again... +> + +And checking that the bridge works in the other direction... + +-- +J. +"; + + $fpat = "/^_______________________________________________\nmessages mailing list\nmessages@vassalengine.org\nhttp:\/\/www.vassalengine.org\/mailman\/listinfo\/messages.*/ms"; + + $this->assertEquals($exp, strip_list_footer("Thus spake uckelman: +> The changes appear to have munged SELinux permissions for the list +> bridge. Trying again... +> + +And checking that the bridge works in the other direction... + +-- +J. +_______________________________________________ +messages mailing list +messages@vassalengine.org +http://www.vassalengine.org/mailman/listinfo/messages +", $fpat)); + + $msg = new MailmanMessage(file_get_contents(__DIR__ . '/326')); + list($text, ) = $msg->getFlattenedParts(); + + $this->assertEquals($exp, strip_list_footer($text, $fpat)); + } } ?> -- cgit v1.2.3