From 4988452740e4d8ae347570774f8aaece4372307d Mon Sep 17 00:00:00 2001 From: Joel Uckelman Date: Mon, 27 Feb 2012 01:46:09 +0100 Subject: Added built_post_subject for stripping tags and Re's added by mailing lists. --- src/build_post.php | 29 +++++++++++++++++++++++++++++ test/build_post_test.php | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 src/build_post.php create mode 100644 test/build_post_test.php diff --git a/src/build_post.php b/src/build_post.php new file mode 100644 index 0000000..6d95be1 --- /dev/null +++ b/src/build_post.php @@ -0,0 +1,29 @@ + diff --git a/test/build_post_test.php b/test/build_post_test.php new file mode 100644 index 0000000..72e28a7 --- /dev/null +++ b/test/build_post_test.php @@ -0,0 +1,34 @@ +assertEquals( + build_post_subject($listtag, $forumtag, $subject), + $expected + ); + } + + public function builtPostSubjectProvider() { + return array( + array('[l]', '[f]', '', '(no subject)'), + array('[l]', '[f]', 'Re:', '(no subject)'), + array('[l]', '[f]', 'Subject', 'Subject'), + array('[l]', '[f]', 'Re: Subject', 'Subject'), + array('[l]', '[f]', 'Re: Re: Re: Subject', 'Subject'), + array('[l]', '[f]', '[f] Subject', 'Subject'), + array('[l]', '[f]', '[f] [f] Subject', 'Subject'), + array('[l]', '[f]', '[f] [f] Subject [f]', 'Subject'), + array('[l]', '[f]', '[l] [f] Re: Subject', 'Subject'), + array('[l]', '[f]', 'Re: [l] [f] Subject', 'Subject'), + array('[l]', '[f]', 'Re: Subject [l][f] Subject', 'Subject Subject') + ); + } +} + +?> -- cgit v1.2.1